[deploy-all] improve workflow
Infrastructure / Check infrastructure definitions (push) Has been skipped Details
Infrastructure / Deploy modified infrastructure (push) Failing after 1m34s Details
Infrastructure / Deploy all infrastructure (push) Successful in 1m27s Details

This commit is contained in:
Gleb Koval 2023-09-02 19:12:34 +01:00
parent 3e69b5bc6a
commit bf46e528f8
Signed by: cyclane
GPG Key ID: 15E168A8B332382C
2 changed files with 24 additions and 3 deletions

View File

@ -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 {} \;

View File

@ -21,4 +21,4 @@
update: true
- name: Start test-vm
community.general.proxmox_kvm:
state: started
state: restarted