diff --git a/.github/workflows/infra.yaml b/.github/workflows/infra.yaml index c51d7cc..427b9b9 100644 --- a/.github/workflows/infra.yaml +++ b/.github/workflows/infra.yaml @@ -11,12 +11,12 @@ on: paths: - infra/**-playbook.yaml - .github/workflows/infra.yaml - fork: jobs: check: name: Check infrastructure definitions runs-on: ubuntu-latest + if: github.ref != 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v3 @@ -31,7 +31,7 @@ jobs: pip3 install -r requirements.txt ansible-galaxy collection install community.general - - name: Check modified playbooks + - name: Check playbooks run: | find . -wholename "*/infra/*-playbook.yaml" -type f -exec ansible-playbook --inventory ./inventory --check {} \; deploy: @@ -66,3 +66,24 @@ jobs: ansible-playbook --inventory ./inventory "$file" fi done + deploy-all: + name: Deploy all infrastructure + runs-on: ubuntu-latest + if: startsWith(github.event.head_commit.message, '[deploy-all]') + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + pip3 install -r requirements.txt + ansible-galaxy collection install community.general + + - name: Run playbooks + run: | + find . -wholename "*/infra/*-playbook.yaml" -type f -exec ansible-playbook --inventory ./inventory {} \; diff --git a/infra/test-vm/proxmox-playbook.yaml b/infra/test-vm/proxmox-playbook.yaml index e8c20bf..2d500e3 100644 --- a/infra/test-vm/proxmox-playbook.yaml +++ b/infra/test-vm/proxmox-playbook.yaml @@ -21,4 +21,4 @@ update: true - name: Start test-vm community.general.proxmox_kvm: - state: started + state: restarted