PSPadam S.// Engineering Notes
arrow_backAll articles
DevOpsJun 14, 2026 • 13 min read • 24.6k reads

Zero-Downtime Deploys on AWS ECS with GitHub Actions (Blue/Green)

The exact pipeline I use: migrations without locks, health-checked deregistration, automated rollback on p99 regression.

PS
Padam ShankhadevPrincipal Full-Stack Engineer • 10+ yrs production
deploy.yml
# expand-contract migrate pattern
- run: php artisan migrate --force  # additive only
- uses: aws-actions/amazon-ecs-deploy-task-definition@v2
  with:
    wait-for-service-stability: true
    codedeploy-appspec: appspec.yaml

Deployments should be boring

If deploys feel scary, the pipeline is missing guardrails. My standard: additive-only migrations (expand then contract), ECS blue/green with CodeDeploy, ALB health checks with deregistration delay, and automatic rollback when error rate or p99 breaches for 5 minutes.

GitHub Actions runs test → build → push → migrate → shift 10% traffic → bake 5 min → shift 100%. Total cycle: ~9 minutes, multiple times a day.

Migration discipline

Never rename/drop a column in one deploy. Step 1: add new column, dual-write. Step 2: backfill. Step 3 (next release): switch reads, drop old. This single rule eliminates 80% of deploy outages I have seen.

verifiedKey takeaways

  • arrow_rightAdditive migrations + blue/green = calm deploys.
  • arrow_rightCanary 10% with auto-rollback on SLO burn.
  • arrow_rightDeregistration delay matters more than you think.
Found this useful? Share it with your team.

Keep reading

alternate_emailThe Ship Log — Newsletter

One production lesson, every 2 weeks. No fluff.

Join 4,200+ engineers getting deep-dives on Laravel scaling, Python workers, Postgres tuning and frontend performance. Read by engineers at SaaS teams shipping to millions.

check_circleFree forevercheck_circleUnsubscribe anytime

TLS encrypted • 4,200+ subscribers • 48% open rate