GitHub Actions Auto Deploy to VPS: The Workflow I Use for Every Backend
Frontends auto-deploy through Cloudflare Pages — push to GitHub, live in 90 seconds. Backends don't get that luxury. They run on a VPS, and updating them used to mean SSH in, pull the latest code, restart the service, and hope nothing broke in the process. GitHub Actions fixes this. Push to main, an automated workflow SSHs into the server, pulls the code, and restarts the service. No manual steps. The deploy happens whether I'm at my desk or on my phone. I set this up once for my first project and now every backend uses the same pattern. What GitHub Actions Does GitHub Actions is a free automation system built into GitHub. It runs tasks when specific events happen in your repository — a push, a pull request, a scheduled time. Each task runs on a GitHub-provided virtual machine that exists for the duration of the task and then disappears. For backend deployment, the task is simple: connect to your VPS via SSH, pull the latest code, restart the service. The whole thing...