Skip to content
Latchkey

How to Matrix-Deploy to Multiple Regions With GitHub Actions

Fan the deploy job out over a region matrix so every region rolls out in parallel from one job definition.

Put your regions in strategy.matrix.region and reference matrix.region in the deploy command. Set fail-fast: false so one slow or failing region does not cancel the others, and max-parallel to bound concurrency.

Steps

  • List regions under strategy.matrix.region.
  • Set fail-fast: false so all regions report independently.
  • Use matrix.region in the deploy command.

Workflow

.github/workflows/deploy.yml
permissions: { id-token: write, contents: read }
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      max-parallel: 3
      matrix:
        region: [us-east-1, eu-west-1, ap-southeast-2]
    steps:
      - uses: actions/checkout@v4
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::123456789012:role/deploy
          aws-region: ${{ matrix.region }}
      - run: ./scripts/deploy.sh --region ${{ matrix.region }}

Common pitfalls

  • Leaving fail-fast at its default true cancels remaining regions on the first failure, hiding which others would also fail.
  • Shared global resources (a single DNS record or CDN) deployed from every leg cause races; deploy global pieces once, not per region.
  • Region-specific quotas can make one leg fail while others pass; treat each region result independently.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →