Skip to main content

Git Workflow

In one line: Single-developer workflow with four persistent branches (dev → test → pprd → prod), each mapped to a Neon DB branch. Gates get stricter at every stage, no direct pushes to prod, and commits follow Conventional Commits.

Branch Strategy

Single developer workflow with 4 persistent branches, each mapped to an environment: Flow direction: dev → test → pprd → prod Work happens on dev (or short-lived feature branches off dev). Code must pass all CI gates at each stage before being promoted. No direct pushes to prod.

Branch Protection Rules

Database Per Environment

All environments use Neon DB branches within a single Neon project — no separate paid projects needed.

Prod → pprd Data Replication

Every 24 hours, a GitHub Actions cron job uses the Neon Branch Reset API to sync pprd from prod.
1

Reset the branch

Call the Neon API to reset the pprd branch from prod.
2

Anonymise PII

Run a PII anonymisation script — names, phone numbers, and emails are replaced with fake data.
3

Ready for UAT

pprd is now a clean, realistic copy of prod without real customer data.
This is faster than pg_dump / pg_restore because Neon branching is a near-instant copy-on-write operation at the storage layer.

CI/CD Pipeline

Gates are cumulative — each stage adds checks on top of the previous one.

Commit Conventions

Use Conventional Commits for clean history and automatic changelog generation:

Pre-Commit Hooks

Every git commit automatically runs Biome lint + format on staged files via Husky + lint-staged:
This catches formatting issues and obvious lint errors before they ever reach CI — saving pipeline minutes and avoiding “fix lint” commits.

Secrets Management

Never commit secrets to git. Use .env.local locally (gitignored) and GitHub Actions secrets in CI.

Deployment

  • rgss-web (theroyalglow.in), rgss-admin (admin.theroyalglow.in) and rgss-cms (cms.theroyalglow.in)
  • Auto-deploy on push to prod, built and started with Bun (next buildnext start)
  • Zero-downtime deploys via Render’s rolling restart
  • Rollback: redeploy a previous commit from the Render dashboard

Weekly Backup

Every Sunday at 2 AM UTC, a GitHub Actions workflow:
1

Dump

Run pg_dump against the Neon prod branch.
2

Upload

Upload the compressed dump to Cloudflare R2 (backups/weekly/).
3

Retain

Keep 8 weeks of backups.
4

Heartbeat

Ping the BetterStack heartbeat on success.
Last modified on August 29, 2026