diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92af7ea..717f7a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,12 @@ name: Build Electron app on: workflow_dispatch: + inputs: + apiBaseUrl: + description: "API base URL" + required: false + default: "fromchat.ru" + type: string push: branches: ["main"] paths: @@ -53,6 +59,8 @@ jobs: - name: Build Electron app shell: bash + env: + VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }} run: npm run build:electron - name: Upload artifact @@ -99,6 +107,8 @@ jobs: - name: Build Electron app shell: bash + env: + VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }} run: npm run build:electron - name: Upload artifact @@ -148,6 +158,8 @@ jobs: - name: Build Electron app shell: bash + env: + VITE_API_BASE_URL: ${{ inputs.apiBaseUrl }} run: npm run build:electron - name: Upload artifact diff --git a/frontend/src/core/config.ts b/frontend/src/core/config.ts index c117bd0..3471754 100644 --- a/frontend/src/core/config.ts +++ b/frontend/src/core/config.ts @@ -9,7 +9,7 @@ * Base domain name for all requests in production * @constant */ -export const BASE_DOMAIN = "fromchat.ru"; +export const BASE_DOMAIN = import.meta.env.VITE_API_BASE_URL ?? "fromchat.ru"; /** * Base API endpoint for all backend requests