@@ -205,13 +205,25 @@ jobs:
205
205
- name : Set up Docker Buildx
206
206
if : runner.os == 'Linux'
207
207
uses : docker/setup-buildx-action@v1
208
+ - name : Docker Meta
209
+ if : runner.os == 'Linux'
210
+ id : docker-meta
211
+ uses : docker/metadata-action@v4
212
+ with :
213
+ images : |
214
+ # This is only a placeholder name, we don't actually use this information.
215
+ name=cross
216
+ labels : |
217
+ org.opencontainers.image.title=cross (for ${{ matrix.target }})
218
+ org.opencontainers.image.licenses=MIT OR Apache-2.0
208
219
- name : Build and push Docker image
209
220
id : build-docker-image
210
221
if : runner.os == 'Linux'
211
222
timeout-minutes : 60
212
223
run : ./build-docker-image.sh "${TARGET}"
213
224
env :
214
225
TARGET : ${{ matrix.target }}
226
+ LABELS : ${{ steps.docker-meta.outputs.labels }}
215
227
shell : bash
216
228
- name : Set Docker image for test
217
229
if : steps.build-docker-image.outputs.image
@@ -250,7 +262,20 @@ jobs:
250
262
registry : ghcr.io
251
263
username : ${{ github.actor }}
252
264
password : ${{ secrets.GITHUB_TOKEN }}
253
-
265
+ - name : Docker Meta
266
+ if : >
267
+ runner.os == 'Linux' && (
268
+ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) ||
269
+ startsWith(github.ref, 'refs/tags/v')
270
+ )
271
+ id : docker-meta2
272
+ uses : docker/metadata-action@v4
273
+ with :
274
+ images : |
275
+ name=${{ steps.build-docker-image.outputs.image }}
276
+ labels : |
277
+ org.opencontainers.image.title=cross (for ${{ matrix.target }})
278
+ org.opencontainers.image.licenses=MIT OR Apache-2.0
254
279
- name : Push image to GitHub Container Registry
255
280
if : >
256
281
runner.os == 'Linux' && (
@@ -260,6 +285,7 @@ jobs:
260
285
run : ./build-docker-image.sh --push "${TARGET}"
261
286
env :
262
287
TARGET : ${{ matrix.target }}
288
+ LABELS : ${{ steps.docker-meta2.outputs.labels }}
263
289
shell : bash
264
290
265
291
publish :
0 commit comments