Development and Deployment
Branching Workflow for Fastify Server
Section titled “Branching Workflow for Fastify Server”1. Main Branches
Section titled “1. Main Branches”main→ production code only.staging→ integration/testing before production.
2. Feature Workflow
Section titled “2. Feature Workflow”- Start from
stagingfor new work:
git checkout staginggit pull origin staginggit checkout -b feature/your-feature-
Do your work on
feature/your-feature. -
Open a PR into
staging.- Staging gets deployed to your staging server automatically (CI/CD).
- QA/testing happens here.
3. Promotion to Production
Section titled “3. Promotion to Production”- When staging is stable:
git checkout maingit pull origin maingit merge staginggit push origin mainmainis then deployed to production.
4. Hotfixes
Section titled “4. Hotfixes”If production is broken:
- Branch from
main:
git checkout maingit pull origin maingit checkout -b hotfix/urgent-fix- Fix → PR into
main. - After merging, also merge into
stagingto keep them in sync.
5. Environment Mapping
Section titled “5. Environment Mapping”- Dev branches → local testing (
http://localhost:3000). - Staging branch → deployed staging server (
https://staging.gigmanager.com). - Main branch → production server (
https://gigmanager.com).
6. Automation (CI/CD)
Section titled “6. Automation (CI/CD)”Use CI/CD (GitHub Actions, GitLab CI, etc.):
- Push/merge to
staging→ auto-deploy staging server. - Push/merge to
main→ auto-deploy production.
Summary:
- Developers experiment in isolated branches.
- Staging always reflects “next release candidate.”
- Main always reflects “live production.”