Skip to main content

Deploy All Components

Run a workflow across every component instance in your stacks. Generate the job matrix from Atmos instead of maintaining a separate inventory in your workflow.

Use Setup Atmos to pin the Atmos container version, enable native CI reporting, and configure authentication and permissions for your repository.

Workflow​

Fan out across every instance defined in your stacks using atmos list instances --format=matrix. Use this for full deploys, drift sweeps across the whole estate, or initial bootstraps. Like describe affected, it auto-routes to $GITHUB_OUTPUT when CI is enabled.

.github/workflows/deploy-all.yml
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # Daily drift sweep

permissions:
id-token: write
contents: read
statuses: write
checks: write

jobs:
inventory:
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudposse/atmos:${{ vars.ATMOS_VERSION }}
outputs:
matrix: ${{ steps.list.outputs.matrix }}
steps:
- uses: actions/checkout@v6

- id: list
run: atmos list instances --format=matrix

deploy:
needs: inventory
if: ${{ needs.inventory.outputs.matrix != '' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudposse/atmos:${{ vars.ATMOS_VERSION }}
strategy:
matrix: ${{ fromJson(needs.inventory.outputs.matrix) }}
fail-fast: false
steps:
- uses: actions/checkout@v6

- env:
COMPONENT: ${{ matrix.component }}
STACK: ${{ matrix.stack }}
run: atmos terraform deploy "$COMPONENT" -s "$STACK"