From 921e8ae1599254d6c07fa5f77c69e47e7fc94ab5 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 | 2 +- 2 files changed, 9 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 a0150ea..fc457a2 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,4 @@ loadtest/pprof /docs # K3s secrets -k3s/secret.yaml \ No newline at end of file +k3s/secret.yaml.playwright-mcp/