GitHub Branching Strategy for Multi Account Environments

In partnership with

TechOps Examples

Hey โ€” It's Govardhana MK ๐Ÿ‘‹

Along with a use case deep dive, we identify the remote job opportunities, top news, tools, and articles in the TechOps industry.

๐Ÿ‘‹ Before we begin... a big thank you to today's sponsor WRITER

Writer RAG tool: build production-ready RAG apps in minutes

RAG in just a few lines of code? Weโ€™ve launched a predefined RAG tool on our developer platform, making it easy to bring your data into a Knowledge Graph and interact with it with AI. With a single API call, writer LLMs will intelligently call the RAG tool to chat with your data.

Integrated into Writerโ€™s full-stack platform, it eliminates the need for complex vendor RAG setups, making it quick to build scalable, highly accurate AI workflows just by passing a graph ID of your data as a parameter to your RAG tool.

IN TODAY'S EDITION

๐Ÿง  Use Case

  • GitHub Branching Strategy for Multi Account Environments

๐Ÿš€ Top News

๐Ÿ‘€ Remote Jobs

๐Ÿ“š๏ธ Resources

  • Fargate vs EC2

    Explore how AWS Fargate eliminates node management with per-pod scaling, why EC2 shines for cost-efficient shared workloads, and see real-world setups that reveal the trade-offs in action.

๐Ÿ› ๏ธ TOOL OF THE DAY

SlimToolkit - Secure your Docker containers without requiring changes to your original container image.

  • Ideal for use with multiple programming languages on different OS environments.

  • Make your containers better, smaller, more Secure.

๐Ÿง  USE CASE

GitHub Branching Strategy for Multi Account Environments

Efficiently managing deployments across sandbox, development, test, staging, and production accounts requires more than just pushing updates.

An ideal approach should reduce deployment risks, support gated approvals, and ensure that only tested and approved code reaches production, maintaining system integrity across accounts.

This specific GitHub branching strategy proves to be incredibly handy.

Architecture Overview:

Ref: AWS Prespective Guidance

Hereโ€™s the simplified breakdown of the flow depicting the movement of code through various environments and approval stages from development to production.

Release Flow:

1. Develop code on the feature/* branch in the Sandbox account.

2. Deploy to Sandbox from feature/* branch for testing.

3. Create merge request for feature/* branch to merge into the main branch.

4. Merge feature/* to main branch.

5. Build, publish artifacts in Develop environment.

6. deploy from main branch to Develop environment.

7. Deploy with gated approval to Test environment.

8. Deploy with gated approval to Stage environment.

9. Deploy with gated approval to Production environment.

Hotfix Flow:

HF1. Develop code on the hotfix/* branch in the Sandbox account.

HF2. Deploy to Sandbox from hotfix/* branch for testing.

HF3. Create merge request for hotfix/* branch to merge into the main branch.

4. Merge hotfix/* to main branch.

5 - 9. Same as release flow. (Develop โ†’ Test โ†’ Staging โ†’ Prod deployments with gated approvals)

Bugfix Flow:

BF1. Develop code on the bugfix/* branch in the Sandbox account.

BF2. Deploy to Sandbox from bugfix/* branch for testing.

BF3. Create merge request for bugfix/* branch to merge into the main branch.

4. Merge bugfix/* to main branch.

5 - 9. Same as release flow. (Develop โ†’ Test โ†’ Staging โ†’ Prod deployments with gated approvals)

Accounts Overview:

  • Sandbox/Develop Accounts: Feature development and testing are isolated in feature branches. Developers can work on feature branches, manually deploy, and test their changes. Once done, the code is merged into the main branch.

  • Test/Stage Accounts: Here, more controlled environments come into play. Code from the main branch undergoes further testing, and once features are ready for production, they go through deployments with gated approvals to avoid premature release.

  • Production Accounts: The final, stable code on gated approvals gets pushed to production. Continuous integration need to ensure that only stable and verified code reaches production.

Things to Consider:

  1. Automation Pipelines: Ensure that pipelines are automated for each environment, from build to deployment, to avoid manual errors. Use CI/CD triggers to manage this based on branch updates (e.g., only deploy to develop when a branch merges to main).

  2. Branch Naming Conventions: Enforce a strict naming convention for branches (e.g., feature/*, hotfix/*, bugfix/*) so everyone knows their purpose.

  3. Testing Strategies: Implement a robust testing strategy at every stage. Code in feature branches should be unit tested, while integration and end-to-end testing should happen at the bugfix/* or main stages.

Final Thoughts: The success of GitHub branching strategy in multi-account cloud setups depends on defined stages, proper gating, and isolated workstreams, which make the code stable, well-tested, and ready for deployment without causing outages.

You may even like:

Looking to promote your company, product, service, or event to 22,000+ TechOps Professionals? Let's work together.