Quick Tip: One Neon Branch Per Pull Request — Free Postgres Previews in 5 Minutes
Description and use
Teams can automatically create free Neon branches per PR, run migrations, and delete the branch on PR close, saving costs and improving CI isolation.
Problem
Teams pay $50‑$200/month for staging databases, but need a fresh preview database per PR for CI and testing.
Outcome
Teams can provision a free, per‑PR Postgres preview database in under 5 minutes, eliminating staging costs and improving CI isolation.
Workflow
- Trigger GitHub Action on pull_request
- Create Neon branch via API call and capture branch ID
- Run database migrations (e.g., alembic upgrade head) against the new branch
- Delete the Neon branch when PR is closed
Evidence
Neon's free tier gives you 10 branches of serverless Postgres — and branches are instant copy-on-write clones.
Branch creation: ~1 second, regardless of DB size (copy-on-write). Storage: 0.5GB free per branch, 3GB project total.
- Record date: 2026-09-18T07:00:21.421Z