A Simple CI/CD Setup with GitHub Actions for a Static Site
For this site, I use GitHub Actions for CI/CD, and I deliberately kept the setup as simple as possible — a great fit for a static site that doesn’t need a complex build process.
The flow is just three main steps:
1. Build. On every push to main, the workflow runs npm ci && npm run build. Since this site is static (Astro), the build output is just a set of HTML/CSS/JS files.
2. Sync to the server. The build output is synced straight to the VPS over SSH using rsync (via the ssh-deploy GitHub Action). No Docker image to build and push to a registry — just copy the static files to the directory Nginx serves.
3. Done. No service restart or database migration step, because there’s neither.
Compared to my old setup (build a Docker image, push to a registry, SSH into the server for docker compose up), this is much faster — from push to live takes tens of seconds, not several minutes.
What I learned from setting this up: pin third-party Action versions explicitly (@v5.1.2, not just @v5, which might not even exist as a tag), and always test that the rsync target path is correct before fully relying on the automation — I once got bitten by a path typo that made the sync silently fail.
For a personal static site, CI/CD doesn’t have to be complicated. Fewer moving parts means fewer things that can break.