From e43773aa7104ce56c20a65ef416efc3753a376e9 Mon Sep 17 00:00:00 2001 From: M1ngdaXie <156019134+M1ngdaXie@users.noreply.github.com> Date: Sat, 15 Aug 2026 16:32:10 +0800 Subject: [PATCH] fix: set production VITE_API_URL/VITE_WS_URL explicitly in CI build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .gitea/workflows/deploy.yml | 8 ++++++++ .gitignore | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 1e71e75..a178202 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -29,6 +29,14 @@ jobs: - name: Build 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: | npm ci npm run build diff --git a/.gitignore b/.gitignore index 6066bf2..474c964 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ postgres_data/ #test folder profiles loadtest/pprof -/docs \ No newline at end of file +/docs + +.playwright-mcp/