-
-
Notifications
You must be signed in to change notification settings - Fork 12
44 lines (37 loc) · 1.68 KB
/
docker-merge.yml
File metadata and controls
44 lines (37 loc) · 1.68 KB
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
name: Merge images
on:
workflow_dispatch: # allow explicit dispatches from arch-specific builds
workflow_call: # allow this workflow to be called by another workflow
env:
IMAGE: ${{ vars.DOCKERHUB_IMAGE }}
REGISTRY: docker.io
concurrency: # ensure only one merge runs at a time
group: merge-manifest
cancel-in-progress: false
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with: # these are defined in the GitHub Secrets UI
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Merge the multiple architecture-specific images into a single multi-arch image.
# If images for other architectures do not exist in the registry yet, this step will fail.
# It will only succeed when at least one image for each architecture has been built and pushed.
# If images for other architectures are being built and the ones in the registry
# are old, it only updates the nightly tag for the architecture that triggered this
# workflow. When images for other architectures are built successfully later, they will
# trigger this workflow again and merge the updated images.
- name: Create multi-arch manifest
run: |
docker buildx imagetools create \
-t ${REGISTRY}/${IMAGE}:nightly \
${REGISTRY}/${IMAGE}:nightly-linux-amd64 \
${REGISTRY}/${IMAGE}:nightly-linux-arm64
- name: Verify multi-arch manifest
run: |
docker buildx imagetools inspect ${REGISTRY}/${IMAGE}:nightly