Deployment Runbook
Step-by-step procedures for deploying, verifying, and rolling back the booking platform.
Pre-Deployment Checklist
- [ ] All CI checks pass on the target branch (
bun run verify) - [ ] Database migrations reviewed and tested on staging
- [ ] Environment variables confirmed in Cloudflare Workers dashboard
- [ ]
CLOUDFLARE_API_TOKENandCLOUDFLARE_ACCOUNT_IDset in GitHub Secrets - [ ] Sentry release created and source maps uploaded
- [ ] Stakeholders notified of deployment window
- [ ] Rollback plan reviewed
Deployment Steps
1. Run Database Migrations
bash
bun run --cwd packages/database drizzle-kit migrateVerify migration output for errors before proceeding.
2. Deploy Website
bash
bun run --cwd apps/website deploy3. Deploy Admin
bash
bun run --cwd apps/admin deploy4. Deploy Docs (if changed)
bash
bun run build:docs
bun run --cwd docs deploy5. Verify Deployment
Check each endpoint:
bash
curl -sS https://booking.example.com/.health
curl -sS https://admin.booking.example.com/.health
curl -sS https://docs.booking.example.com/.healthAll endpoints must return 200 OK with {"status":"healthy"}.
6. Smoke Test Critical Flows
- Customer signup and login
- Provider search and booking creation
- Stripe checkout (test mode)
- Admin dashboard loads
- Chat message send and receive
Post-Deployment Verification
- [ ] Health endpoints return healthy
- [ ] Sentry shows no new errors
- [ ] Cloudflare Analytics shows normal traffic
- [ ] No alerts triggered (check Slack
#alertschannel if configured) - [ ] Smoke tests pass
- [ ] Deployment announcement sent to stakeholders
Rollback Procedure
Instant Rollback via Wrangler
bash
wrangler deployments rollback --name booking-website
wrangler deployments rollback --name booking-adminDatabase Rollback
If a migration caused issues:
- Identify the problematic migration
- Create a new
downmigration inpackages/database/src/adapters/migrations/ - Run
bun run --cwd packages/database drizzle-kit migrate - Verify data integrity
Rollback Verification
- [ ] Health endpoints return healthy
- [ ] Sentry error rate returns to baseline
- [ ] Critical flows functional
- [ ] Stakeholders notified of rollback
Emergency Contacts
| Role | Contact | Escalation |
|---|---|---|
| On-call engineer | See PagerDuty schedule | If unreachable within 15 min, escalate to secondary |
| Engineering lead | See team directory | For decisions affecting data integrity |
| Cloudflare support | Cloudflare dashboard | For platform-level incidents |
Deployment Window
- Standard: Tuesday–Thursday 10:00–16:00 UTC
- Emergency: Anytime with on-call approval
- Freeze: During major holidays and announced freeze periods