Skip to content

Fix CI/CD deploy for the new server#142

Merged
vinybrun merged 1 commit into
mainfrom
fix/cicd-new-server
Jun 6, 2026
Merged

Fix CI/CD deploy for the new server#142
vinybrun merged 1 commit into
mainfrom
fix/cicd-new-server

Conversation

@vinybrun

@vinybrun vinybrun commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Why

The old VPS died and the site moved to a new server with a different user, path, and deploy model. The existing Deploy to VM workflow targeted the old box (guia user, /var/www/sovereinia/guia, server-side git pull + build), so deploys would fail.

What changed

Reworked .github/workflows/deploy-to-vm.yml to the new layout:

  • Build on the runner (npm ci && npm run build) instead of pulling/building on the server — no server-side Node or git checkout needed.
  • rsync dist//srv/apps/sovereinia/guia/, which nginx serves live as static files (Vite base: '/guia/'). No nginx restart.
  • Deploy as a new least-privilege deploy user (no sudo, owns only the guia serving dir) using a dedicated SSH deploy key stored in the SSH_PRIVATE_KEY secret. If that key leaks it can only overwrite the guide files — not run root commands.
  • Added a post-deploy smoke test against https://sovereinia.org/guia/.

Verification

Triggered via workflow_dispatch on this branch — full run green (build → rsync → smoke test 200). Confirmed on the server the files were rewritten by the deploy user with fresh content hashes. Run: https://github.com/Sovereinia/guia/actions/runs/27075223594

Notes

  • Server-side prerequisites are already in place (the deploy user, its authorized_keys, directory ownership, and the updated SSH_PRIVATE_KEY secret).
  • The SSH_PASSPHRASE secret is now unused and can be deleted.
  • Merging this to main will trigger a real push-deploy.

🤖 Generated with Claude Code

The old VPS died; the new server uses a different layout, user, and path.
Rework the deploy workflow to match it:

- Build on the GitHub runner (npm ci && npm run build) instead of pulling
  and building on the server. No server-side Node/git needed.
- rsync the built dist/ to /srv/apps/sovereinia/guia/ (nginx serves it live
  as static files, so no nginx restart).
- Deploy as the new least-privilege `deploy` user (no sudo, owns only the
  guia serving dir) using a dedicated SSH deploy key (SSH_PRIVATE_KEY).
- Add a post-deploy smoke test against https://sovereinia.org/guia/.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vinybrun vinybrun merged commit 2f9af7e into main Jun 6, 2026
1 check passed
@vinybrun vinybrun deleted the fix/cicd-new-server branch June 6, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant