Skip to content

Commit 3976d97

Browse files
committed
feat: do multi arch builds on different runners
1 parent 7742c90 commit 3976d97

File tree

1 file changed

+59
-12
lines changed

1 file changed

+59
-12
lines changed

.github/workflows/build_docker.yml

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- id: set-matrix
2121
run: echo "matrix=$(cat build_versions.json | jq -c)" >> $GITHUB_OUTPUT
2222

23-
build-and-push-container:
23+
build-X86-container:
2424
runs-on: ubuntu-latest
2525
permissions:
2626
contents: read
@@ -40,17 +40,64 @@ jobs:
4040
OPENVOXDB_VERSION=${{ matrix.db_version }}
4141
R10K_VERSION=${{ matrix.r10k_version }}
4242
RUGGED_VERSION=${{ matrix.rugged_version }}
43-
build_arch: linux/amd64,linux/arm64
43+
build_arch: linux/amd64
4444
build_context: openvoxserver
4545
buildfile: openvoxserver/Containerfile
4646
tags: |
47-
ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-${{ github.ref_name }}
48-
ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-latest
49-
ghcr.io/openvoxproject/openvoxserver:latest
50-
51-
# - name: Update Docker Hub Description for shortname
52-
# uses: peter-evans/dockerhub-description@v4
53-
# with:
54-
# username: voxpupulibot
55-
# password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }}
56-
# repository: openvoxproject/openvoxserver
47+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
48+
49+
build-ARM-container:
50+
runs-on: ubuntu-24.04-arm
51+
permissions:
52+
contents: read
53+
packages: write
54+
needs: setup-matrix
55+
strategy:
56+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
57+
steps:
58+
- name: Build OpenVox Server ${{ matrix.release }} container
59+
uses: voxpupuli/gha-build-and-publish-a-container@v2
60+
with:
61+
registry_password: ${{ secrets.GITHUB_TOKEN }}
62+
build_args: |
63+
OPENVOX_RELEASE=${{ matrix.release }}
64+
OPENVOXSERVER_VERSION=${{ matrix.server_version }}
65+
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
66+
OPENVOXDB_VERSION=${{ matrix.db_version }}
67+
R10K_VERSION=${{ matrix.r10k_version }}
68+
RUGGED_VERSION=${{ matrix.rugged_version }}
69+
build_arch: linux/arm64
70+
build_context: openvoxserver
71+
buildfile: openvoxserver/Containerfile
72+
tags: |
73+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64
74+
75+
create-multiarch-manifests:
76+
runs-on: ubuntu-latest
77+
needs:
78+
- setup-matrix
79+
- build-X86-container
80+
- build-ARM-container
81+
strategy:
82+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
83+
steps:
84+
- name: Log in to the ghcr.io registry
85+
uses: docker/login-action@v3
86+
with:
87+
registry: ghcr.io
88+
username: ${{ github.repository_owner }}
89+
password: ${{ secrets.GITHUB_TOKEN }}
90+
91+
- name: Create multiarch manifests
92+
run: |
93+
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-${{ github.ref_name }} \
94+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
95+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
96+
97+
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.server_version }}-latest \
98+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
99+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
100+
101+
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:latest \
102+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
103+
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64

0 commit comments

Comments
 (0)