From 5def3c14e87d4ea2ad00b919f8e980eec9b9400d Mon Sep 17 00:00:00 2001 From: M1ngdaXie <156019134+M1ngdaXie@users.noreply.github.com> Date: Sat, 15 Aug 2026 15:26:33 +0800 Subject: [PATCH] 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 --- .gitea/workflows/deploy.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..232afae --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,30 @@ +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: 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 + run: | + npm ci + npm run build + + - name: Deploy frontend + run: rsync -a --delete frontend/dist/ /var/www/realtime-collab/