[deploy-all] improve workflow
This commit is contained in:
parent
3e69b5bc6a
commit
bf46e528f8
|
@ -11,12 +11,12 @@ on:
|
||||||
paths:
|
paths:
|
||||||
- infra/**-playbook.yaml
|
- infra/**-playbook.yaml
|
||||||
- .github/workflows/infra.yaml
|
- .github/workflows/infra.yaml
|
||||||
fork:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check infrastructure definitions
|
name: Check infrastructure definitions
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref != 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -31,7 +31,7 @@ jobs:
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
ansible-galaxy collection install community.general
|
ansible-galaxy collection install community.general
|
||||||
|
|
||||||
- name: Check modified playbooks
|
- name: Check playbooks
|
||||||
run: |
|
run: |
|
||||||
find . -wholename "*/infra/*-playbook.yaml" -type f -exec ansible-playbook --inventory ./inventory --check {} \;
|
find . -wholename "*/infra/*-playbook.yaml" -type f -exec ansible-playbook --inventory ./inventory --check {} \;
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -66,3 +66,24 @@ jobs:
|
||||||
ansible-playbook --inventory ./inventory "$file"
|
ansible-playbook --inventory ./inventory "$file"
|
||||||
fi
|
fi
|
||||||
done
|
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 {} \;
|
||||||
|
|
|
@ -21,4 +21,4 @@
|
||||||
update: true
|
update: true
|
||||||
- name: Start test-vm
|
- name: Start test-vm
|
||||||
community.general.proxmox_kvm:
|
community.general.proxmox_kvm:
|
||||||
state: started
|
state: restarted
|
||||||
|
|
Loading…
Reference in New Issue