Skip to content

Branch deploys

Deploy feature branches to test environments before merging to production
Branch deploys

Why branch deploys are better

Traditional deployments follow a “merge then deploy” pattern, merging multiple branches into a release branch and then deploying it all at once.

This can lead to many potential problems:

  • Broken code in main
  • Complex rollbacks requiring multiple reverts and untangling commits
  • Unclear ownership of production issues
  • Limited or no production testing

Branch deploys solve these issues by reversing the order: deploy first, then merge. This small change has big benefits.

Most importantly, we can safely deploy branches assuming they meet a small set of criteria:

  • They are up to date with what is in main with no merge conflicts
  • All tests are passing

Core benefits

Safer releases

Test your changes in production while main stays clean. If something breaks, your main branch remains stable and ready for other deploys.

Simple rollbacks

No need for complex revert commits. Just redeploy main and your system returns to a known good state.

Clear ownership

The developer who wrote the code stays responsible through deployment. No more “throwing code over the wall” to ops teams.

Better visibility

Every deploy is tracked and visible to the team. You always know what’s running and who deployed it.

How it works

Branch deploys fit naturally into your development workflow:

  1. Create and review your PR
  2. Pass CI checks
  3. Deploy branch to production
  4. Verify in production
  5. Merge to main

Deployment options

Choose how you want to deploy:

  • Web UI for direct control
  • Slack for team visibility
  • GitHub Actions for automation
  • API for custom workflows

Origins and philosophy

This workflow emerged from years of experience at GitHub and successfully scaled to hundreds of developers.

The key benefits of branch deploys on fast moving teams:

  • Developer ownership of changes in production
  • High pull request and deployment velocity
  • Final real-world verification
  • Almost no downtime due to bad deploys and quick recovery from bad code

Best practices

Deploy frequently

Small, frequent deploys reduce risk. They’re easier to verify and roll back if needed.

Review thoroughly

Complete code review before deploying. Use this time to catch issues before they hit production.

Own your deploys

Keep code authors responsible for deployments. They know the code best and can respond quickly if issues arise.

Stay transparent

Use Slack to keep your team informed about deploys. Good communication prevents deploy conflicts and helps everyone learn from issues.