S
StaffLoans
app

Deployment Runbook

Step-by-step procedures for safe, reliable deployments

1Pre-Deployment
1

Create feature branch

git checkout -b feature/xyz
2

Develop and test locally

npm run test
3

Push to GitHub

git push origin feature/xyz
4

Create pull request

PR template applies automatically
5

Code review & approval

Requires 2 approvals
2Staging Deployment
1

Merge to develop

git merge --squash feature/xyz
2

CI/CD pipeline runs

Tests, lint, security scan
3

Auto-deploy to staging

kubectl apply -f k8s/staging/
4

Run smoke tests

npm run test:smoke:staging
5

Notify team in Slack

Automatic @here notification
3Production Deployment
1

Create release branch

git checkout -b release/v1.2.3
2

Update version numbers

npm version minor
3

Create GitHub release

Tag: v1.2.3
4

Create database backup

backup-db production
5

Run migrations

npm run migrate:prod
6

Deploy to production

kubectl apply -f k8s/production/
7

Health check (5 retries)

curl https://api.staffloans.com/health
8

Smoke tests on production

npm run test:smoke:prod
9

Notify stakeholders

Slack + email
4Post-Deployment
1

Monitor error rate

Check Sentry dashboard
2

Monitor latency

Check Datadog metrics
3

Monitor throughput

Check request volume
4

Watch logs

tail -f logs/production.log
5

Be ready to rollback

kubectl rollout undo deployment/api
Emergency Contacts

Deployment Lead

On-call: @devops-oncall (Slack)

Quick Rollback

Channel: #incidents (notify all)

Post-Mortem

Due: 24 hours after incident