From 724cbe83f46ba601f88a93aa0e611743671461c6 Mon Sep 17 00:00:00 2001 From: Vektor19 Date: Sun, 28 Dec 2025 23:34:11 +0200 Subject: [PATCH] feat/249: modify yml and fix loading backend url from .env --- ...1c3b230f.yml => azure-static-web-apps.yml} | 96 +++++++++---------- src/app/api/agent.api.ts | 3 +- 2 files changed, 49 insertions(+), 50 deletions(-) rename .github/workflows/{azure-static-web-apps-agreeable-ground-01c3b230f.yml => azure-static-web-apps.yml} (91%) diff --git a/.github/workflows/azure-static-web-apps-agreeable-ground-01c3b230f.yml b/.github/workflows/azure-static-web-apps.yml similarity index 91% rename from .github/workflows/azure-static-web-apps-agreeable-ground-01c3b230f.yml rename to .github/workflows/azure-static-web-apps.yml index 3916c50..b8f1878 100644 --- a/.github/workflows/azure-static-web-apps-agreeable-ground-01c3b230f.yml +++ b/.github/workflows/azure-static-web-apps.yml @@ -1,48 +1,48 @@ -name: Azure Static Web Apps CI/CD - -on: - push: - branches: - - main - - dev - pull_request: - types: [opened, synchronize, reopened, closed] - branches: - - main - - dev - -jobs: - build_and_deploy_job: - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') - runs-on: ubuntu-latest - name: Build and Deploy Job - steps: - - uses: actions/checkout@v3 - with: - submodules: true - lfs: false - - name: Build And Deploy - id: builddeploy - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_GROUND_01C3B230F }} - repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) - action: "upload" - ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### - # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig - app_location: "/" # App source code path - api_location: "" # Api source code path - optional - output_location: "dist" # Built app content directory - optional - ###### End of Repository/Build Configurations ###### - - close_pull_request_job: - if: github.event_name == 'pull_request' && github.event.action == 'closed' - runs-on: ubuntu-latest - name: Close Pull Request Job - steps: - - name: Close Pull Request - id: closepullrequest - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_AGREEABLE_GROUND_01C3B230F }} - action: "close" +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main + - dev + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - main + - dev + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + lfs: false + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/" # App source code path + api_location: "" # Api source code path - optional + output_location: "dist" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} + action: "close" diff --git a/src/app/api/agent.api.ts b/src/app/api/agent.api.ts index 821db4e..a0983da 100644 --- a/src/app/api/agent.api.ts +++ b/src/app/api/agent.api.ts @@ -6,8 +6,7 @@ import { ReasonPhrases, StatusCodes } from 'http-status-codes'; import FRONTEND_ROUTES from '../common/constants/frontend-routes.constants'; import UserLoginStore from '../stores/user-login-store'; -axios.defaults.baseURL = process.env.NODE_ENV === 'development' - ? 'https://localhost:7146/api' : 'https://app-streetcode-webapi-eu-prop-001-gsbqfwc2fdh6hhaw.polandcentral-01.azurewebsites.net/api'; +axios.defaults.baseURL = process.env.REACT_APP_BACKEND_URL || 'https://localhost:5001/api'; axios.interceptors.response.use( async (response) => response,