pez-infra/.github/workflows/deploy-on-merge.yml
Rasmus "Pez" Wejlgaard 9f84652102
fix: cleanup deploy.yml and share workflow (#108)
* fix: cleanup deploy.yml and share workflow

* lint issue
2026-05-15 20:17:28 +01:00

36 lines
817 B
YAML

name: Deploy (on merge)
on:
push:
branches:
- main
paths-ignore:
- "terraform/**"
jobs:
discover:
name: Discover hosts
runs-on: ubuntu-latest
outputs:
hosts: ${{ steps.discover.outputs.hosts }}
steps:
- uses: actions/checkout@v6
- name: Read hosts from inventory
id: discover
run: |
HOSTS=$(grep 'ansible_host=' ansible/inventory/hosts.ini | awk '{print $1}' | jq -R . | jq -cs .)
echo "hosts=$HOSTS" >> "$GITHUB_OUTPUT"
deploy:
needs: discover
strategy:
matrix:
host: ${{ fromJson(needs.discover.outputs.hosts) }}
fail-fast: false
uses: ./.github/workflows/_deploy-core.yml
with:
host: ${{ matrix.host }}
playbook: deploy.yml
dry_run: false
secrets: inherit