From 97223b5b3e44e9e66c10aa087a59c8b4c4e9aa57 Mon Sep 17 00:00:00 2001 From: rowell_m_soriano Date: Thu, 30 Jul 2026 14:35:05 +0800 Subject: [PATCH] adding secrete for vite_base_url_api --- .gitea/workflows/deploy.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7be6b92..a7fbf41 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -26,8 +26,19 @@ jobs: shell: pwsh run: npm ci - # Uses the committed .env (e.g. .env.production) picked up automatically by Vite - - # no secrets injected at build time for this project. + # ---- Inject VITE_API_BASE_URL from a Gitea secret so the API URL never has to be + # hand-edited/committed again - only this secret needs updating when the API moves. + # This OVERWRITES .env.production before the build; Vite bakes it into the bundle + # at build time (Vite env vars are compile-time, not runtime), so nothing needs + # to change on the IIS/deploy side. + - name: Write production env - Frontend + shell: pwsh + env: + API_BASE_URL: ${{ secrets.LSFE_FRONTEND_VITE_API_BASE_URL }} + run: | + "VITE_API_BASE_URL=$env:API_BASE_URL" | Out-File -FilePath ".\.env.production" -Encoding utf8 -NoNewline + Write-Host "Wrote .env.production (value not echoed)" + - name: Build (Vite production build) shell: pwsh run: npm run build