Skip to content

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_TOKEN and CLOUDFLARE_ACCOUNT_ID set 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 migrate

Verify migration output for errors before proceeding.

2. Deploy Website

bash
bun run --cwd apps/website deploy

3. Deploy Admin

bash
bun run --cwd apps/admin deploy

4. Deploy Docs (if changed)

bash
bun run build:docs
bun run --cwd docs deploy

5. 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/.health

All 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 #alerts channel 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-admin

Database Rollback

If a migration caused issues:

  1. Identify the problematic migration
  2. Create a new down migration in packages/database/src/adapters/migrations/
  3. Run bun run --cwd packages/database drizzle-kit migrate
  4. Verify data integrity

Rollback Verification

  • [ ] Health endpoints return healthy
  • [ ] Sentry error rate returns to baseline
  • [ ] Critical flows functional
  • [ ] Stakeholders notified of rollback

Emergency Contacts

RoleContactEscalation
On-call engineerSee PagerDuty scheduleIf unreachable within 15 min, escalate to secondary
Engineering leadSee team directoryFor decisions affecting data integrity
Cloudflare supportCloudflare dashboardFor 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

Released under the MIT License.