fix: set production VITE_API_URL/VITE_WS_URL explicitly in CI build

The Gitea Actions workflow checks out a fresh copy of the repo via
actions/checkout, which never has frontend/.env.local (it's gitignored,
only exists in the manually-maintained /root/realtime-collab clone).
Without it, Vite silently fell back to the localhost dev defaults and
baked a broken API URL into the production bundle — every CI-triggered
build overwrote a working manual build with a broken one.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
M1ngdaXie
2026-08-15 16:32:47 +08:00
co-authored by Claude Sonnet 5
parent 656976ff1e
commit e43773aa71
2 changed files with 11 additions and 1 deletions
+8
View File
@@ -29,6 +29,14 @@ jobs:
- name: Build frontend - name: Build frontend
working-directory: frontend working-directory: frontend
env:
# frontend/.env.local holds these for the manually-maintained
# /root/realtime-collab checkout, but it's gitignored, so this
# actions/checkout-based workspace never has it — without setting
# them here, Vite silently falls back to the localhost dev
# defaults and bakes a broken API URL into the production bundle.
VITE_API_URL: https://collab.m1ngdaxie.com/api
VITE_WS_URL: wss://collab.m1ngdaxie.com/ws
run: | run: |
npm ci npm ci
npm run build npm run build
+3 -1
View File
@@ -39,4 +39,6 @@ postgres_data/
#test folder profiles #test folder profiles
loadtest/pprof loadtest/pprof
/docs /docs
.playwright-mcp/