-
Notifications
You must be signed in to change notification settings - Fork 7
215 lines (215 loc) · 5.75 KB
/
ci-master.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
name: ci master
'on':
push:
branches:
- master
jobs:
project-done:
name: Project Done
needs:
- project-checks
steps:
- run: true
runs-on: ubuntu-latest
all-done:
name: All Done
needs:
- file-lint
- git-lint
- project-done
steps:
- run: true
runs-on: ubuntu-latest
docker-done:
name: Docker Done
needs:
- audit-trivy
- dockerfile-lint
steps:
- run: true
runs-on: ubuntu-latest
workflow-check:
name: Workflow Check
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Git Fetch
run: |
git fetch
- name: Configurator
run: |
make -C ${GITHUB_WORKSPACE}/src/configurator run-all
git status
git diff-index --quiet HEAD -- || (echo "Changes found"; git diff)
git diff-index --quiet HEAD --
runs-on: ubuntu-latest
file-lint:
name: File Lint
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: cr
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-cr
- name: crlf
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-crlf
- name: trailing-newline
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-trailing-newline
ignore: '.git/,*.png,*.jpg,*.jpeg,*.ico,*.svg,docs/*.md'
- name: trailing-single-newline
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-trailing-single-newline
ignore: '.git/,*.png,*.jpg,*.jpeg,*.ico,*.svg,docs/*.md'
- name: utf8
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-utf8
- name: utf8-bom
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-utf8-bom
- name: trailing-space
uses: dogmatic69/actions/file/lint/awesome-ci@master
with:
command: file-trailing-space
ignore: '.git/,*.png,*.jpg,*.jpeg,*.ico,*.svg,docs/*.md'
- name: Checkmake
uses: dogmatic69/actions/file/lint/checkmake@master
- uses: ibiqlik/action-yamllint@master
with:
config_file: .yamllint.yml
name: yaml-lint
runs-on: ubuntu-latest
git-lint:
name: Git Lint
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Git conflicts
uses: dogmatic69/actions/git/lint/awesome-ci@master
with:
command: git-conflicts
- name: Git ignored
uses: dogmatic69/actions/git/lint/awesome-ci@master
with:
command: git-ignored
- name: Git Leaks
uses: dogmatic69/actions/git/audit/gitleaks@master
runs-on: ubuntu-latest
audit-trivy:
name: Audit Trivy
strategy:
matrix:
image:
- docker/audit/trivy
- docker/lint/hadolint
- docker/service
- file/lint/awesome-ci
- file/lint/checkmake
- git/audit/gitleaks
- git/lint/awesome-ci
- src/documentation
- src/configurator
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Build
run: |
docker build -t ${{ matrix.image }} ./${{ matrix.image }}
- name: 'Trivy Scan ${{ matrix.image }}'
uses: dogmatic69/actions/docker/audit/trivy@master
with:
token: '${{ secrets.GITHUB_TOKEN }}'
image: '${{ matrix.image }}'
path: './${{ matrix.image }}'
runs-on: ubuntu-latest
dockerfile-lint:
name: Dockerfile lint
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: Hadolint
uses: dogmatic69/actions/docker/lint/hadolint@master
runs-on: ubuntu-latest
project-checks:
name: Project Checks
strategy:
matrix:
image:
- src/configurator
- src/documentation
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: lint
run: |
make -C ${{ matrix.image }} lint
- name: test
run: |
make -C ${{ matrix.image }} test
runs-on: ubuntu-latest
publish:
name: Publish
needs:
- all-done
strategy:
matrix:
service:
- src/configurator
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 1
- name: fetch
run: |
git fetch
- name: Git Fetch
run: |
git fetch
- name: Publish
run: >
make -C ${{ matrix.service }} publish DOCKER_USER=${{ github.actor }}
DOCKER_TOKEN=${{ secrets.GITHUB_TOKEN }} ENVIRONMENT=stage
runs-on: ubuntu-latest
update-docs:
name: Update Documentation
runs-on: ubuntu-latest
needs:
- all-done
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@master
- name: Build docs
run: |
make -C ${GITHUB_WORKSPACE}/src/documentation run
- name: Commit files
run: |
cd ${GITHUB_WORKSPACE}
git config --local user.email "[email protected]"
git config --local user.name "Action Bot"
git add docs || true
git commit -m "chore: update documentation (auto-generated)" -a \
|| true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'