-
Notifications
You must be signed in to change notification settings - Fork 1
281 lines (268 loc) · 8.54 KB
/
docker.yaml
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: Docker Publish
on:
push:
branches:
- 'main'
tags:
- 'base-httpd-*'
- 'kiwix-serve-*'
- 'edupi-*'
- 'file-browser-*'
- 'captive-portal-*'
- 'reverse-proxy-*'
- 'dashboard-*'
- 'wikifundi-*'
- 'hwclock-*'
jobs:
identify:
name: Identify which projects to build
runs-on: ubuntu-22.04
outputs:
base-httpd: ${{ steps.ident.outputs.base-httpd }}
kiwix-serve: ${{ steps.ident.outputs.kiwix-serve }}
edupi: ${{ steps.ident.outputs.edupi }}
file-browser: ${{ steps.ident.outputs.file-browser }}
captive-portal: ${{ steps.ident.outputs.captive-portal }}
reverse-proxy: ${{ steps.ident.outputs.reverse-proxy }}
dashboard: ${{ steps.ident.outputs.dashboard }}
wikifundi: ${{ steps.ident.outputs.wikifundi }}
hwclock: ${{ steps.ident.outputs.hwclock }}
steps:
- uses: actions/checkout@v3.4.0
with:
fetch-depth: 2
- name: Get changed files
id: files
uses: tj-actions/changed-files@v34.3.4
with:
separator: ','
- id: ident
shell: python
env:
FILES: ${{ steps.files.outputs.all_changed_and_modified_files }}
run: |
import os
print("changed-files", os.getenv("FILES"))
projects = set()
# for tags like `base-httpd-2.0.1`
if os.getenv("GITHUB_REF_TYPE") == "tag":
projects.add(os.getenv("GITHUB_REF_NAME").rsplit("-", 1)[0])
for fname in os.getenv("FILES").split(","):
if len(fname.split("/")) > 1:
projects.add(fname.split("/")[0])
for project in projects:
with open(os.getenv("GITHUB_OUTPUT"), "a") as fh:
fh.write("{project}=yes\n".format(project=project))
base-httpd:
name: Publish base-httpd Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.base-httpd == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish base-httpd Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/base-httpd
on-master: dev
tag-pattern: /^base-httpd-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: base-httpd
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
kiwix-serve:
name: Publish kiwix-serve Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.kiwix-serve == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish kiwix-serve Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/kiwix-serve
build-args:
VERSION={tag}
tag-pattern: /^kiwix-serve-([0-9.\-]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: kiwix-serve
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
edupi:
name: Publish edupi Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.edupi == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish edupi Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/edupi
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^edupi-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: edupi
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
file-browser:
name: Publish file-browser Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.file-browser == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish file-browser Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/file-browser
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^file-browser-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: file-browser
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
captive-portal:
name: Publish captive-portal Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.captive-portal == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish captive-portal Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/captive-portal
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^captive-portal-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: captive-portal
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
reverse-proxy:
name: Publish reverse-proxy Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.reverse-proxy == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish reverse-proxy Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/reverse-proxy
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^reverse-proxy-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: reverse-proxy
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
dashboard:
name: Publish dashboard Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.dashboard == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish dashboard Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/dashboard
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^dashboard-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: dashboard
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
wikifundi:
name: Publish wikifundi Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.wikifundi == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish wikifundi Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/wikifundi
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^wikifundi-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: wikifundi
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}
hwclock:
name: Publish hwclock Image
runs-on: ubuntu-22.04
needs: identify
if: ${{ needs.identify.outputs.hwclock == 'yes' }}
steps:
- uses: actions/checkout@v3.4.0
- name: Publish hwclock Image
uses: openzim/docker-publish-action@v10
with:
image-name: offspot/hwclock
on-master: dev
build-args:
VERSION={tag}
tag-pattern: /^hwclock-([0-9.]+)$/
restrict-to: offspot/container-images
platforms: |
linux/amd64
linux/arm64
context: hwclock
registries: ghcr.io
credentials:
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }}
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }}