Skip to content

Commit dd14d6a

Browse files
authored
Merge pull request #11 from flownative/task/native-arm-build
Do native ARM build in docker.build.yaml
2 parents 2a0bd97 + 7f3a463 commit dd14d6a

File tree

1 file changed

+69
-22
lines changed

1 file changed

+69
-22
lines changed

.github/workflows/docker.build.yaml

Lines changed: 69 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Build
22
on:
3+
workflow_dispatch:
34
schedule:
45
- cron: '30 11 * * *'
56
push:
@@ -9,9 +10,13 @@ on:
910
- 'v*.*.*'
1011

1112
jobs:
12-
build:
13-
# Downgrade due to segfault issus with qemu
14-
runs-on: ubuntu-22.04
13+
prepare:
14+
runs-on: ubuntu-24.04
15+
outputs:
16+
version: ${{ steps.latest_version.outputs.version }}
17+
tag: ${{ steps.latest_version.outputs.tag }}
18+
tags: ${{ steps.meta.outputs.tags }}
19+
labels: ${{ steps.meta.outputs.labels }}
1520
steps:
1621
- uses: actions/checkout@v5
1722
with:
@@ -51,14 +56,14 @@ jobs:
5156
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest_version.outputs.version }}
5257
type=semver,pattern={{version}},value=${{ steps.latest_version.outputs.version }}
5358
54-
- name: Set up QEMU
55-
id: qemu
56-
uses: docker/setup-qemu-action@v3
59+
build-intel:
60+
needs: [prepare]
61+
runs-on: ubuntu-24.04
62+
steps:
63+
- uses: actions/checkout@v4
5764
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
65+
ref: ${{ needs.prepare.outputs.tag }}
66+
fetch-depth: 100
6267

6368
- name: Set up Docker Buildx
6469
id: buildx
@@ -88,23 +93,56 @@ jobs:
8893
uses: docker/build-push-action@v6
8994
with:
9095
context: .
91-
platforms: linux/amd64,linux/arm64
96+
platforms: linux/amd64
9297
push: true
93-
tags: ${{ steps.meta.outputs.tags }}
94-
labels: ${{ steps.meta.outputs.labels }}
98+
tags: ${{ needs.prepare.outputs.tags }}
99+
labels: ${{ needs.prepare.outputs.labels }}
95100

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

105143
release-helm:
106-
runs-on: ubuntu-latest
107-
needs: build
144+
runs-on: ubuntu-24.04
145+
needs: [build-intel, build-arm]
108146
permissions:
109147
contents: write
110148
packages: write
@@ -134,3 +172,12 @@ jobs:
134172
repository_path: 'beach-charts'
135173
repository_user: ${{ secrets.HARBOR_BEACH_CHARTS_USERNAME }}
136174
repository_password: ${{ secrets.HARBOR_BEACH_CHARTS_PASSWORD }}
175+
176+
- name: Send mail for Opsgenie heartbeat
177+
uses: dawidd6/action-send-mail@v4
178+
with:
179+
connection_url: ${{secrets.OPSGENIE_HEARTBEAT_MAIL_CREDENTIALS}}
180+
subject: Github Actions heartbeat ping
181+
182+
from: Github Actions <[email protected]>
183+
body: Build job of ${{github.repository}} completed successfully!

0 commit comments

Comments
 (0)