-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.41 KB
/
check-ansible.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Check
on:
pull_request:
branches: [main]
env:
SLACK_INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
jobs:
deploy-essentials:
name: Deploy essentials
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify essentials file changed
uses: tj-actions/changed-files@v37.4.0
id: changed_files
with:
files: |
ansible/inventories/hosts.ini
ansible/playbooks/_essentials/*
ansible/playbooks/essentials.yml
- name: Deploy essentials
id: deploy-essentials
if: steps.changed_files.outputs.any_changed == 'true'
uses: dawidd6/action-ansible-playbook@v2
with:
directory: ansible
playbook: playbooks/essentials.yml
key: "${{ secrets.SSH_PRIVATE_KEY }}"
options: --user ansible
check-playbooks:
name: Check playbook
runs-on: ubuntu-latest
needs: [deploy-essentials]
strategy:
matrix:
playbook:
- snapshots_crab
steps:
- uses: actions/checkout@v2
- name: Run playbook
uses: dawidd6/action-ansible-playbook@v2
with:
directory: ansible
playbook: playbooks/${{ matrix.playbook }}/playbook.yml
key: "${{ secrets.SSH_PRIVATE_KEY }}"
options: --user ansible --verbose --diff --check