Skip to main content
deploy-all.yml1.4 KB
View on GitHub
name: Deploy All
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *' # Daily drift sweep

jobs:
inventory:
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudposse/atmos:${{ vars.ATMOS_VERSION }}
outputs:
matrix: ${{ steps.list.outputs.matrix }}
count: ${{ steps.list.outputs.count }}
steps:
- env:
GIT_TOKEN: ${{ secrets.GITEA_TOKEN }}
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: credential.helper
GIT_CONFIG_VALUE_0: '!f() { echo username=oauth2; echo "password=$GIT_TOKEN"; }; f'
run: atmos git clone --ci

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

deploy:
needs: inventory
if: ${{ needs.inventory.outputs.count != '0' }}
runs-on: ubuntu-latest
container:
image: ghcr.io/cloudposse/atmos:${{ vars.ATMOS_VERSION }}
strategy:
matrix: ${{ fromJson(needs.inventory.outputs.matrix) }}
fail-fast: false
steps:
- env:
GIT_TOKEN: ${{ secrets.GITEA_TOKEN }}
GIT_CONFIG_COUNT: 1
GIT_CONFIG_KEY_0: credential.helper
GIT_CONFIG_VALUE_0: '!f() { echo username=oauth2; echo "password=$GIT_TOKEN"; }; f'
run: atmos git clone --ci

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