Compare commits

...
3 Commits
Author SHA1 Message Date
M1ngdaXieandClaude Sonnet 5 e43773aa71 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]>
2026-08-15 16:32:47 +08:00
M1ngdaXieandClaude Sonnet 5 656976ff1e fix: import backend image into k3s containerd before rollout
docker build only populates the Docker daemon's store; k3s runs its
own embedded containerd and never sees it, so imagePullPolicy: Never
kept redeploying whatever was last imported instead of new builds.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-15 16:09:51 +08:00
M1ngdaXieandClaude Sonnet 5 733a7218fa ci: add manual Gitea Actions deploy workflow
Rebuilds and rolls out the backend, then builds and syncs the
frontend to nginx. Triggered manually via workflow_dispatch so pushes
don't auto-deploy to production.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-08-15 15:30:06 +08:00
2 changed files with 48 additions and 1 deletions
+45
View File
@@ -0,0 +1,45 @@
name: Deploy
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest # hits the host runner (vps-runner) already on this box
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build backend image
run: docker build -t realtime-collab-backend:latest ./backend
- name: Import image into k3s containerd
# docker build only populates the Docker daemon's store; k3s runs its
# own containerd (imagePullPolicy: Never, never pulls a registry), so
# the image must be explicitly imported or the pod keeps running
# whatever was last imported.
run: docker save realtime-collab-backend:latest | k3s ctr -n k8s.io images import -
- name: Roll out backend
run: |
kubectl rollout restart deployment/realtime-collab-backend
kubectl rollout status deployment/realtime-collab-backend --timeout=90s
- 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
- name: Deploy frontend
run: rsync -a --delete frontend/dist/ /var/www/realtime-collab/
+3 -1
View File
@@ -39,4 +39,6 @@ postgres_data/
#test folder profiles
loadtest/pprof
/docs
/docs
.playwright-mcp/