-
-
Notifications
You must be signed in to change notification settings - Fork 36
225 lines (179 loc) · 7.72 KB
/
buildx.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
216
217
218
219
220
221
222
223
224
225
name: buildx
on:
schedule:
- cron: "37 04 * * *"
push:
branches:
- master
pull_request:
jobs:
buildx:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
docker-file:
- path: 8/jdk/18
tags: "8-jdk-18 8-jdk-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 8/jdk/18/alpine
tags: "8-alpine-jdk-18 8-alpine-jdk-hydrogen"
platforms: linux/amd64
- path: 8/jdk/20
tags: "8-jdk-20 8-jdk-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 8/jdk/20/alpine
tags: "8-alpine-jdk-20 8-alpine-jdk-iron"
platforms: linux/amd64
- path: 8/jre/18
tags: "8-jre-18 8-jre-hydrogen 8-18 8-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 8/jre/18/alpine
tags: "8-alpine-18 8-alpine-hydrogen 8-alpine-jre-18 8-alpine-jre-hydrogen"
platforms: linux/amd64
- path: 8/jre/20
tags: "8-jre-20 8-jre-iron 8-20 8-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 8/jre/20/alpine
tags: "8-alpine-20 8-alpine-iron 8-alpine-jre-20 8-alpine-jre-iron"
platforms: linux/amd64
- path: 11/jdk/18
tags: "11-jdk-18 11-jdk-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 11/jdk/18/alpine
tags: "11-alpine-jdk-18 11-alpine-jdk-hydrogen"
platforms: linux/amd64
- path: 11/jdk/20
tags: "11-jdk-20 11-jdk-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 11/jdk/20/alpine
tags: "11-alpine-jdk-20 11-alpine-jdk-iron"
platforms: linux/amd64
- path: 11/jre/18
tags: "11-18 11-hydrogen 11-jre-18 11-jre-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 11/jre/18/alpine
tags: "11-alpine-18 11-alpine-hydrogen 11-alpine-jre-18 11-alpine-jre-hydrogen"
platforms: linux/amd64
- path: 11/jre/20
tags: "11-20 11-iron 11-jre-20 11-jre-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 11/jre/20/alpine
tags: "11-alpine-20 11-alpine-iron 11-alpine-jre-20 11-alpine-jre-iron"
platforms: linux/amd64
- path: 17/jdk/18
tags: "17-jdk-18 17-jdk-hydrogen jdk-18 jdk-18-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 17/jdk/18/alpine
tags: "alpine-jdk-18 alpine-jdk-hydrogen 17-alpine-jdk-18 17-alpine-jdk-hydrogen"
platforms: linux/amd64
- path: 17/jdk/20
tags: "17-jdk-20 17-jdk-iron jdk-20 jdk-20-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 17/jdk/20/alpine
tags: "17-alpine-jdk-20 17-alpine-jdk-iron"
platforms: linux/amd64
- path: 17/jre/18
tags: "17-18 17-hydrogen 17-jre-18 17-jre-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 17/jre/18/alpine
tags: "17-alpine-18 17-alpine-hydrogen 17-alpine-jre-18 17-alpine-jre-hydrogen"
platforms: linux/amd64
- path: 17/jre/20
tags: "17-20 17-iron 17-jre-20 17-jre-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7
- path: 17/jre/20/alpine
tags: "17-alpine-20 17-alpine-iron 17-alpine-jre-20 17-alpine-jre-iron"
platforms: linux/amd64
- path: 21/jdk/18
tags: "21-jdk-18 21-jdk-hydrogen jdk-18 jdk-18-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 21/jdk/18/alpine
tags: "alpine-jdk-18 alpine-jdk-hydrogen 21-alpine-jdk-18 21-alpine-jdk-hydrogen"
platforms: linux/amd64
- path: 21/jdk/20
tags: "21-jdk-20 21-jdk-iron jdk-20 jdk-20-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 21/jdk/20/alpine
tags: "alpine-jdk-20 alpine-jdk-iron 21-alpine-jdk-20 21-alpine-jdk-iron"
platforms: linux/amd64
- path: 21/jre/18
tags: "21-18 21-hydrogen 21-jre-18 21-jre-hydrogen"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 21/jre/18/alpine
tags: "21-alpine-18 21-alpine-hydrogen 21-alpine-jre-18 21-alpine-jre-hydrogen alpine-18 alpine-hydrogen alpine-jre-18 alpine-jre-hydrogen"
platforms: linux/amd64
- path: 21/jre/20
tags: "21-20 21-iron 21-jre-20 21-jre-iron"
platforms: linux/amd64,linux/arm64,linux/ppc64le
- path: 21/jre/20/alpine
tags: "21-alpine-20 21-alpine-iron 21-alpine-jre-20 21-alpine-jre-iron alpine-20 alpine-iron alpine-jre-20 alpine-jre-iron"
platforms: linux/amd64
steps:
- name: Checkout
uses: actions/[email protected]
- name: Workaround Docker bug in runner
run: |
sudo rm /etc/docker/daemon.json
sudo systemctl restart docker
- name: Prepare
id: prepare
run: |
DOCKER_IMAGE=timbru31/java-node
TEMP="${{ matrix.docker-file.tags }}"
TAGZ=($TEMP)
VERSION=${TAGZ[0]}
for i in "${!TAGZ[@]}"; do
if [ "$i" -eq "0" ];
then
TAGS="${DOCKER_IMAGE}:${TAGZ[$i]}"
else
TAGS="${TAGS},${DOCKER_IMAGE}:${TAGZ[$i]}"
fi
done
echo "docker_image=${DOCKER_IMAGE}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
with:
install: true
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Docker Buildx (build)
uses: docker/[email protected]
if: success() && !contains(github.ref, 'master')
with:
push: false
context: ./${{ matrix.docker-file.path }}
file: ./${{ matrix.docker-file.path }}/Dockerfile
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
platforms: ${{ matrix.docker-file.platforms }}
tags: ${{ steps.prepare.outputs.tags }}
- name: Docker Login
if: success() && github.event_name != 'pull_request' && contains(github.ref, 'master')
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Docker Buildx (push)
uses: docker/[email protected]
if: success() && github.event_name != 'pull_request' && contains(github.ref, 'master')
with:
push: true
context: ./${{ matrix.docker-file.path }}
file: ./${{ matrix.docker-file.path }}/Dockerfile
build-args: REFRESHED_AT=$(date +%Y-%m-%d)
platforms: ${{ matrix.docker-file.platforms }}
tags: ${{ steps.prepare.outputs.tags }}
- name: Inspect Image
if: always() && github.event_name != 'pull_request' && contains(github.ref, 'master')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
- name: Clear
if: always() && github.event_name != 'pull_request'
run: |
rm -f ${HOME}/.docker/config.json