Skip to content

Commit 16ef0c3

Browse files
authored
Merge pull request #139 from voxpupuli/multi-arch-builds
ci: introduce multi arch builds on dedicated runners
2 parents 49d3c92 + dd1120e commit 16ef0c3

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

.github/workflows/build_container.yml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@ permissions:
1616

1717
jobs:
1818
build-and-push-container:
19-
runs-on: ubuntu-latest
19+
runs-on: ${{ matrix.runner }}
2020
permissions:
2121
contents: read
2222
packages: write
23+
strategy:
24+
matrix:
25+
include:
26+
- label: x86_64
27+
platform: amd64
28+
runner: ubuntu-24.04
29+
- label: AArch64
30+
platform: arm64
31+
runner: ubuntu-24.04-arm
2332
steps:
2433
- name: Source checkout
2534
uses: actions/checkout@v6
@@ -28,13 +37,52 @@ jobs:
2837
uses: voxpupuli/gha-build-and-publish-a-container@v2
2938
with:
3039
registry_password: ${{ secrets.GITHUB_TOKEN }}
31-
build_arch: linux/amd64,linux/arm64
40+
build_arch: linux/${{ matrix.platform }}
3241
buildfile: Containerfile
3342
docker_username: voxpupulibot
3443
docker_password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}
3544
tags: |
36-
ghcr.io/voxpupuli/renovate:latest
37-
docker.io/voxpupuli/renovate:latest
45+
ghcr.io/${{ github.repository_owner }}/renovate:${{ github.sha }}-${{ matrix.platform }}
46+
47+
create-multiarch-manifests:
48+
runs-on: ubuntu-latest
49+
permissions:
50+
contents: read
51+
packages: write
52+
needs:
53+
- build-and-push-container
54+
steps:
55+
- name: Log in to the ghcr.io registry
56+
uses: docker/login-action@v4
57+
with:
58+
registry: ghcr.io
59+
username: ${{ github.repository_owner }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Log in to the docker.io registry
63+
uses: docker/login-action@v4
64+
with:
65+
registry: docker.io
66+
username: voxpupulibot
67+
password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}
68+
69+
- name: Create multiarch manifests
70+
run: |
71+
docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/renovate:latest \
72+
ghcr.io/${{ github.repository_owner }}/renovate:${{ github.sha }}-arm64 \
73+
ghcr.io/${{ github.repository_owner }}/renovate:${{ github.sha }}-amd64
74+
75+
docker buildx imagetools create -t docker.io/${{ github.repository_owner }}/renovate:latest \
76+
ghcr.io/${{ github.repository_owner }}/renovate:${{ github.sha }}-arm64 \
77+
ghcr.io/${{ github.repository_owner }}/renovate:${{ github.sha }}-amd64
78+
79+
update-dockerhub-description:
80+
runs-on: ubuntu-latest
81+
needs:
82+
- create-multiarch-manifests
83+
steps:
84+
- name: Source checkout
85+
uses: actions/checkout@v6
3886

3987
- name: Update Docker Hub Description
4088
uses: peter-evans/dockerhub-description@v5

0 commit comments

Comments
 (0)