Dev Rebuilds CI/CD Pipeline to Eliminate Silent Production Failures on VPS
A developer overhauled their Node.js/TypeScript deployment architecture after discovering a critical blind spot: remote scripts ran without strict error handling, causing GitHub Actions to report pipeline success even when the production application had crashed. The original setup triggered deployments on every merge to the main branch via SSH, git pull, and pm2 restart, with database migrations running before the application build — meaning a TypeScript error could leave the database altered with no new code deployed. Since Prisma lacks native down migrations, reverting such failures required high-risk manual intervention. The redesigned system requires an annotated SemVer tag to trigger any deployment, passing through six sequential gates including tag validation, automated testing with Vitest, a live migration rehearsal on a disposable copy of the production database, and post-deploy smoke tests. The developer has published the full modular GitHub Actions template as an open-source repository for teams managing similar VPS-hosted applications.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in