adding secrete for vite_base_url_api
All checks were successful
Build and Deploy LSFE Frontend / build-and-deploy (push) Successful in 2m36s
All checks were successful
Build and Deploy LSFE Frontend / build-and-deploy (push) Successful in 2m36s
This commit is contained in:
parent
f568a8aa14
commit
97223b5b3e
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user