Skip to content

Commit 294cce8

Browse files
authored
Do native ARM build in docker.build.yaml
1 parent db2b41e commit 294cce8

File tree

1 file changed

+67
-21
lines changed

1 file changed

+67
-21
lines changed

.github/workflows/docker.build.yaml

+67-21
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ on:
99
- 'v*.*.*'
1010

1111
jobs:
12-
build:
13-
# Downgrade due to segfault issus with qemu
14-
runs-on: ubuntu-22.04
12+
prepare:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
version: ${{ steps.latest_version.outputs.version }}
16+
tag: ${{ steps.latest_version.outputs.tag }}
17+
tags: ${{ steps.meta.outputs.tags }}
18+
labels: ${{ steps.meta.outputs.labels }}
1519
steps:
1620
- uses: actions/checkout@v4
1721
with:
@@ -51,14 +55,14 @@ jobs:
5155
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_version.outputs.version }}
5256
type=semver,pattern={{version}},value=${{ steps.latest_version.outputs.version }}
5357
54-
- name: Set up QEMU
55-
id: qemu
56-
uses: docker/setup-qemu-action@v3
58+
build-intel:
59+
needs: [prepare]
60+
runs-on: ubuntu-24.04
61+
steps:
62+
- uses: actions/checkout@v4
5763
with:
58-
# setup-qemu-action by default uses tonistiigi/binfmt:latest,
59-
# which was out of date, see https://github.com/tonistiigi/binfmt/issues/165.
60-
# Now it has been updated, but still causes segfaults.
61-
image: tonistiigi/binfmt:qemu-v7.0.0
64+
ref: ${{ needs.prepare.outputs.tag }}
65+
fetch-depth: 100
6266

6367
- name: Set up Docker Buildx
6468
id: buildx
@@ -88,23 +92,56 @@ jobs:
8892
uses: docker/build-push-action@v6
8993
with:
9094
context: .
91-
platforms: linux/amd64,linux/arm64
95+
platforms: linux/amd64
9296
push: true
93-
tags: ${{ steps.meta.outputs.tags }}
94-
labels: ${{ steps.meta.outputs.labels }}
97+
tags: ${{ needs.prepare.outputs.tags }}
98+
labels: ${{ needs.prepare.outputs.labels }}
9599

96-
- name: Send mail for Opsgenie heartbeat
97-
uses: dawidd6/action-send-mail@v4
100+
build-arm:
101+
needs: [prepare]
102+
runs-on: ubuntu-24.02-arm
103+
steps:
104+
- uses: actions/checkout@v4
98105
with:
99-
connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}}
100-
subject: Github Actions heartbeat ping
101-
102-
from: Github Actions <[email protected]>
103-
body: Build job of ${{github.repository}} completed successfully!
106+
ref: ${{ needs.prepare.outputs.tag }}
107+
fetch-depth: 100
108+
109+
- name: Set up Docker Buildx
110+
id: buildx
111+
uses: docker/setup-buildx-action@v3
112+
113+
- name: Login to Docker Hub
114+
uses: docker/login-action@v3
115+
with:
116+
username: ${{ secrets.DOCKER_IO_REGISTRY_USER }}
117+
password: ${{ secrets.DOCKER_IO_REGISTRY_PASSWORD }}
118+
119+
- name: Login to Google Artifacts Registry
120+
uses: docker/login-action@v3
121+
with:
122+
registry: europe-docker.pkg.dev/flownative/docker
123+
username: '_json_key'
124+
password: ${{ secrets.GOOGLE_ARTIFACTS_PASSWORD_DOCKER }}
125+
126+
- name: Login to Harbor
127+
uses: docker/login-action@v3
128+
with:
129+
registry: harbor.flownative.io
130+
username: ${{ secrets.HARBOR_BEACH_USERNAME }}
131+
password: ${{ secrets.HARBOR_BEACH_PASSWORD }}
132+
133+
- name: Build Docker image
134+
uses: docker/build-push-action@v6
135+
with:
136+
context: .
137+
platforms: linux/arm64
138+
push: true
139+
tags: ${{ needs.prepare.outputs.tags }}
140+
labels: ${{ needs.prepare.outputs.labels }}
104141

105142
release-helm:
106143
runs-on: ubuntu-latest
107-
needs: build
144+
needs: [build-intel, build-arm]
108145
permissions:
109146
contents: write
110147
packages: write
@@ -134,3 +171,12 @@ jobs:
134171
repository_path: 'beach-charts'
135172
repository_user: ${{ secrets.HARBOR_BEACH_CHARTS_USERNAME }}
136173
repository_password: ${{ secrets.HARBOR_BEACH_CHARTS_PASSWORD }}
174+
175+
- name: Send mail for Opsgenie heartbeat
176+
uses: dawidd6/action-send-mail@v4
177+
with:
178+
connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}}
179+
subject: Github Actions heartbeat ping
180+
181+
from: Github Actions <[email protected]>
182+
body: Build job of ${{github.repository}} completed successfully!

0 commit comments

Comments
 (0)