Quick Tip: One Neon Branch Per Pull Request — Free Postgres Previews in 5 Minutes
Описание и применение
Команды могут автоматически создавать бесплатные ветки Neon для каждой Pull Request, запускать миграции и удалять ветку после закрытия PR, экономя деньги и повышая изоляцию CI.
Задача
Teams pay $50‑$200/month for staging databases, but need a fresh preview database per PR for CI and testing.
Результат
Teams can provision a free, per‑PR Postgres preview database in under 5 minutes, eliminating staging costs and improving CI isolation.
Рабочий процесс
- 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
Доказательства
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.
- Дата записи: 2026-09-18T07:00:21.421Z