-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
area:infraGCP, Nginx, CI/CD, deploymentGCP, Nginx, CI/CD, deploymenttype:setupProject scaffolding and configurationProject scaffolding and configuration
Milestone
Description
Description
Configure a GitHub Actions deployment workflow that deploys to the GCP VM after CI passes.
Deployment Flow
Push to main
→ GitHub Actions: lint + test (existing CI)
→ On success: Deploy job
→ SSH to GCP VM
→ git pull (or rsync built artifacts)
→ npm ci --production
→ Run database migrations (Drizzle migrate)
→ PM2 restart cellarsync
→ Health check (curl /api/health)
→ Notify on failure
GitHub Actions Workflow
- New job
deployin CI workflow (or separate deployment workflow) - Triggered only on push to
main(not on PRs) - Depends on all test jobs passing
- Uses SSH action to connect to GCP VM
SSH Configuration
- GitHub Secrets: SSH private key, VM IP address, SSH user
- SSH key restricted to deployment user on VM
- Known hosts configured to prevent MITM
Deployment Script (on VM)
cd /opt/cellarsync
git pull origin main
npm ci --production
npm run db:migrate
pm2 restart cellarsync
sleep 2
curl -f http://localhost:3001/api/health || (pm2 restart cellarsync && exit 1)Rollback Strategy
git revert+ re-deploy for code rollback- Database migrations are forward-only
- Previous PM2 process snapshot as emergency fallback
- Document rollback procedures
Health Check
- POST-deploy health check:
GET /api/healthreturns 200 - If health check fails, restart PM2 and alert
- GitHub Actions step fails if health check fails (blocks marking deployment as successful)
Notifications
- GitHub Actions failure notification (email or Slack webhook)
- Deployment status badge in README
Acceptance Criteria
- Push to main triggers deployment after CI passes
- SSH connection to VM works securely
- Migrations run automatically
- PM2 restart completes successfully
- Health check verifies deployment
- Failed deployment doesn't leave app in broken state
- Rollback procedure documented and tested
References
- PRD Section 7: Deployment Pipeline, Deployment Strategy
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:infraGCP, Nginx, CI/CD, deploymentGCP, Nginx, CI/CD, deploymenttype:setupProject scaffolding and configurationProject scaffolding and configuration