Promote Deployment
Two-Stage Model
feature branch → staging (preview) → main (production)
- staging: Integration branch. Vercel deploys a preview against Neon
stagingdatabase. - main: Production. Vercel deploys to production against Neon
maindatabase.
Usage
Promote to staging (from a feature branch):
./scripts/promote.sh staging
Promote to production (from staging):
./scripts/promote.sh production
The script runs quality gates automatically, checks for uncommitted changes, and creates a PR via gh.
Manual Promotion Checklist
If the script doesn't fit the situation, follow this sequence exactly:
- Generate migrations:
bunx drizzle-kit generate(if schema changed) - Validate migrations:
bun run db:check - Run all gates:
./scripts/gates.sh - Open PR to
staging - Validate preview deployment against Neon
staging - Open promotion PR from
staging→main - Migrations apply automatically during Vercel build via
DATABASE_URL_UNPOOLED - If migration fails, STOP. Do not retry. Fix the schema/migration drift first.
Database Safety
- Migrations run during Vercel's build step using
DATABASE_URL_UNPOOLED(direct connection). - Production
DATABASE_URLpoints to Neonmainbranch (ep-rapid-pond-akug8qa3). - Run
./scripts/db-branch-check.shif unsure which database you're targeting. - See the
db-healthskill for full database safety rules.
Environment Mapping
| Git Branch | Vercel Environment | Neon Branch |
|---|---|---|
staging | Preview | staging |
main | Production | main |
| feature branches | Preview (PR) | preview/* (auto-forked) |
Guardrails
- Never push directly to
main. Always go through staging first. - Never skip quality gates to speed up deployment.
- Treat migration failures as hard blockers — no retry without a fix.
- Never run
drizzle-kit pushagainst any shared branch.
If You're Lost
- Vercel deployments & environments
- Neon + Vercel integration
- Drizzle ORM migrations
- See docs/release-flow.md for the full delivery checklist