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 thepprd 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.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.- Tab Title
- Tab Title
- Tab Title
- Tab Title
Commit Conventions
Use Conventional Commits for clean history and automatic changelog generation:Pre-Commit Hooks
Everygit commit automatically runs Biome lint + format on staged files via Husky + lint-staged:
Secrets Management
Never commit secrets to git. Use
.env.local locally (gitignored) and
GitHub Actions secrets in CI.Deployment
- Tab Title
- Tab Title
rgss-web(theroyalglow.in),rgss-admin(admin.theroyalglow.in) andrgss-cms(cms.theroyalglow.in)- Auto-deploy on push to
prod, built and started with Bun (next build→next 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
Runpg_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.Related
- Testing — Full CI gate specifications
- Deployment — Platform configuration details
- Environment Variables — All secrets and their purpose