Skip to content

Commit a756ef9

Browse files
authored
Add multi-arch builds for frontend and backend
1 parent ffdb349 commit a756ef9

1 file changed

Lines changed: 111 additions & 0 deletions

File tree

.github/workflows/dev-build.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,44 @@ permissions:
1414
jobs:
1515
build-frontend:
1616
name: Build Frontend Multi-Arch (dev)
17+
build-frontend-amd64:
18+
name: Build Frontend AMD64 (dev)
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout code
2022
uses: actions/checkout@v4
2123

2224
- name: Set up QEMU
2325
uses: docker/setup-qemu-action@v3
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log in to Docker Hub
30+
uses: docker/login-action@v3
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
35+
- name: Build and push Frontend AMD64 (dev)
36+
uses: docker/build-push-action@v5
37+
with:
38+
context: .
39+
file: frontend/Dockerfile
40+
platforms: linux/amd64
41+
push: true
42+
build-args: |
43+
VERSION=${{ env.DEV_VERSION }}
44+
tags: |
45+
${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }}-amd64
46+
cache-from: type=gha,scope=dev-frontend-amd64
47+
cache-to: type=gha,mode=max,scope=dev-frontend-amd64
48+
49+
build-frontend-arm64:
50+
name: Build Frontend ARM64 (dev)
51+
runs-on: ubuntu-24.04-arm
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
2455

2556
- name: Set up Docker Buildx
2657
uses: docker/setup-buildx-action@v3
@@ -32,21 +63,46 @@ jobs:
3263
password: ${{ secrets.DOCKERHUB_TOKEN }}
3364

3465
- name: Build and push Frontend Multi-Arch (dev)
66+
- name: Build and push Frontend ARM64 (dev)
3567
uses: docker/build-push-action@v5
3668
with:
3769
context: .
3870
file: frontend/Dockerfile
3971
platforms: linux/amd64,linux/arm64
72+
platforms: linux/arm64
4073
push: true
4174
build-args: |
4275
VERSION=${{ env.DEV_VERSION }}
4376
tags: |
4477
${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }}
4578
cache-from: type=gha,scope=dev-frontend-multiarch
4679
cache-to: type=gha,mode=max,scope=dev-frontend-multiarch
80+
${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }}-arm64
81+
cache-from: type=gha,scope=dev-frontend-arm64
82+
cache-to: type=gha,mode=max,scope=dev-frontend-arm64
4783

4884
build-backend-native:
4985
name: Build Backend Native Multi-Arch (dev)
86+
create-frontend-manifest:
87+
name: Create Frontend Multi-Arch Manifest (dev)
88+
needs: [build-frontend-amd64, build-frontend-arm64]
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Log in to Docker Hub
92+
uses: docker/login-action@v3
93+
with:
94+
username: ${{ secrets.DOCKERHUB_USERNAME }}
95+
password: ${{ secrets.DOCKERHUB_TOKEN }}
96+
97+
- name: Create and push Frontend manifest (dev)
98+
run: |
99+
docker buildx imagetools create \
100+
-t ${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }} \
101+
${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }}-amd64 \
102+
${{ env.DOCKERHUB_FRONTEND_IMAGE }}:${{ env.DEV_VERSION }}-arm64
103+
104+
build-backend-native-amd64:
105+
name: Build Backend Native AMD64 (dev)
50106
runs-on: ubuntu-latest
51107
steps:
52108
- name: Checkout code
@@ -65,11 +121,13 @@ jobs:
65121
password: ${{ secrets.DOCKERHUB_TOKEN }}
66122

67123
- name: Build and push Backend Native Multi-Arch (dev)
124+
- name: Build and push Backend Native AMD64 (dev)
68125
uses: docker/build-push-action@v5
69126
with:
70127
context: .
71128
file: backend/Dockerfile.native
72129
platforms: linux/amd64,linux/arm64
130+
platforms: linux/amd64
73131
push: true
74132
build-args: |
75133
VERSION=${{ env.DEV_VERSION }}-native
@@ -78,3 +136,56 @@ jobs:
78136
${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native
79137
cache-from: type=gha,scope=dev-backend-native-multiarch
80138
cache-to: type=gha,mode=max,scope=dev-backend-native-multiarch
139+
${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native-amd64
140+
cache-from: type=gha,scope=dev-backend-native-amd64
141+
cache-to: type=gha,mode=max,scope=dev-backend-native-amd64
142+
143+
build-backend-native-arm64:
144+
name: Build Backend Native ARM64 (dev)
145+
runs-on: ubuntu-24.04-arm
146+
steps:
147+
- name: Checkout code
148+
uses: actions/checkout@v4
149+
150+
- name: Set up Docker Buildx
151+
uses: docker/setup-buildx-action@v3
152+
153+
- name: Log in to Docker Hub
154+
uses: docker/login-action@v3
155+
with:
156+
username: ${{ secrets.DOCKERHUB_USERNAME }}
157+
password: ${{ secrets.DOCKERHUB_TOKEN }}
158+
159+
- name: Build and push Backend Native ARM64 (dev)
160+
uses: docker/build-push-action@v5
161+
with:
162+
context: .
163+
file: backend/Dockerfile.native
164+
platforms: linux/arm64
165+
push: true
166+
build-args: |
167+
VERSION=${{ env.DEV_VERSION }}-native
168+
QUARKUS_NATIVE_BUILD_ARGS=
169+
tags: |
170+
${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native-arm64
171+
cache-from: type=gha,scope=dev-backend-native-arm64
172+
cache-to: type=gha,mode=max,scope=dev-backend-native-arm64
173+
174+
create-backend-native-manifest:
175+
name: Create Backend Native Multi-Arch Manifest (dev)
176+
needs: [build-backend-native-amd64, build-backend-native-arm64]
177+
runs-on: ubuntu-latest
178+
steps:
179+
- name: Log in to Docker Hub
180+
uses: docker/login-action@v3
181+
with:
182+
username: ${{ secrets.DOCKERHUB_USERNAME }}
183+
password: ${{ secrets.DOCKERHUB_TOKEN }}
184+
185+
- name: Create and push Backend Native manifest (dev)
186+
run: |
187+
docker buildx imagetools create \
188+
-t ${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native \
189+
${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native-amd64 \
190+
${{ env.DOCKERHUB_BACKEND_IMAGE }}:${{ env.DEV_VERSION }}-native-arm64
191+

0 commit comments

Comments
 (0)