forked from aristanetworks/avd
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (106 loc) · 4.65 KB
/
devel-push.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
# This workflow is conditionned to only run on the main repo
# aristanetworks/ansible-avd and not on forks
# cf - https://github.com/actions/runner/issues/859
# TODO - revisist if a feature is ever published
name: "Devel Code Management"
on:
push:
branches:
- devel
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
file-changes:
runs-on: ubuntu-20.04
outputs:
eos_design: ${{ steps.filter.outputs.eos_design }}
config_gen: ${{ steps.filter.outputs.config_gen }}
cloudvision: ${{ steps.filter.outputs.cloudvision }}
dhcp: ${{ steps.filter.outputs.dhcp }}
plugins: ${{ steps.filter.outputs.plugins }}
requirements: ${{ steps.filter.outputs.requirements }}
docs: ${{ steps.filter.outputs.docs }}
if: |
github.event_name != 'workflow_dispatch' &&
github.repository == 'aristanetworks/ansible-avd'
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
eos_design:
- 'ansible_collections/arista/avd/roles/eos_designs/*'
- 'ansible_collections/arista/avd/roles/eos_designs/**/*'
- 'ansible_collections/arista/avd/molecule/*'
- 'ansible_collections/arista/avd/molecule/**/*'
- '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*'
- '!ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*'
- '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/*'
- '!ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*'
config_gen:
- 'ansible_collections/arista/avd/roles/eos_cli_config_gen/*'
- 'ansible_collections/arista/avd/roles/eos_cli_config_gen/**/*'
- 'ansible_collections/arista/avd/molecule/eos_cli_config_gen/*'
- 'ansible_collections/arista/avd/molecule/eos_cli_config_gen/**/*'
cloudvision:
- 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/*'
- 'ansible_collections/arista/avd/roles/eos_config_deploy_cvp/**/*'
- 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/*'
- 'ansible_collections/arista/avd/molecule/cvp_configlet_upload/**/*'
dhcp:
- 'ansible_collections/arista/avd/roles/dhcp_provisioner/*'
- 'ansible_collections/arista/avd/roles/dhcp_provisioner/**/*'
plugins:
- 'ansible_collections/arista/avd/plugins/filter/**'
- 'ansible_collections/arista/avd/plugins/test/**'
requirements:
- 'ansible_collections/arista/avd/requirements.txt'
- 'ansible_collections/arista/avd/requirements-dev.txt'
- 'ansible_collections/arista/avd/meta/runtime.yml'
docs:
- 'mkdocs.yml'
- 'ansible_collections/arista/avd/docs/**'
- 'ansible_collections/arista/avd/roles/**/*.md'
- 'ansible_collections/arista/avd/**/*.md'
- 'ansible_collections/arista/avd/README.md'
# ----------------------------------- #
# Rebuild docker base image
#
# secrets.AVD_BUILDER_TOKEN needs to be a Personal Access Token to the remote
# repository which is https://github.com/arista-netdevops-community/docker-avd-base
#
# The PAT needs to have specific permissions as described here
# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event
#
# PAT on arista-netdevops-community are allowed and required to be approved by
# admins of the organization
#
# current PAT belongs to @gmuloc
#
# ----------------------------------- #
docker_build:
name: Webhook to 'arista-netdevops-community/docker-avd-base' to build image
runs-on: ubuntu-20.04
needs: file-changes
# run only if on main repo and if
# * either there is a file change
# * or it is a manually triggered workflow on devel
if: |
github.repository == 'aristanetworks/ansible-avd' &&
(needs.file-changes.outputs.requirements == 'true' ||
(github.ref == 'refs/heads/devel' && github.event_name == 'workflow_dispatch'))
steps:
- uses: actions/checkout@v3
- name: 'Trigger avd-base refresh'
run: |
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{secrets.AVD_BUILDER_TOKEN}}" \
https://api.github.com/repos/arista-netdevops-community/docker-avd-base/dispatches \
-d '{"event_type":"refresh"}' \
-f