Refactor workflow file paths and update branch restrictions
This commit is contained in:
@@ -5,7 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "ansible/playbook_*.yml"
|
- ansible/playbook_*.yml
|
||||||
|
- .github/workflows/ansible-apply-playbook.yml
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ansible-apply:
|
ansible-apply:
|
||||||
@@ -18,6 +19,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup environment
|
- name: Setup environment
|
||||||
|
id: setup_env
|
||||||
uses: ./.github/actions/setup-env
|
uses: ./.github/actions/setup-env
|
||||||
|
|
||||||
- name: Setup Ansible environment
|
- name: Setup Ansible environment
|
||||||
@@ -32,7 +34,7 @@ jobs:
|
|||||||
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
VAULT_MASTER_PASSWORD: ${{ secrets.VAULT_MASTER_PASSWORD }}
|
||||||
ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }}
|
ANSIBLE_USER: ${{ secrets.ANSIBLE_USER }}
|
||||||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
|
||||||
CHANGED_FILES: ${{ steps.get_changed_files.outputs.CHANGED_FILES }}
|
CHANGED_FILES: ${{ steps.setup_env.outputs.CHANGED_FILES }}
|
||||||
run: |
|
run: |
|
||||||
cd ansible
|
cd ansible
|
||||||
for PLAYBOOK in $(echo $CHANGED_FILES | grep -oP 'playbook_\K\w+'); do
|
for PLAYBOOK in $(echo $CHANGED_FILES | grep -oP 'playbook_\K\w+'); do
|
||||||
|
|||||||
Reference in New Issue
Block a user