Skip to content

Commit df15a1d

Browse files
committed
Fix release workflow: use single multi-arch Docker build
1 parent 50e637b commit df15a1d

1 file changed

Lines changed: 20 additions & 57 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ env:
1414
IMAGE_NAME: ${{ github.repository }}
1515

1616
jobs:
17-
# Build binaries with GoReleaser (fast, parallel builds)
1817
binaries:
1918
runs-on: ubuntu-latest
2019
steps:
@@ -25,10 +24,13 @@ jobs:
2524
- uses: actions/setup-go@v5
2625
with:
2726
go-version: '1.24'
27+
cache-dependency-path: backend/go.sum
2828

2929
- uses: actions/setup-node@v4
3030
with:
3131
node-version: '20'
32+
cache: 'npm'
33+
cache-dependency-path: frontend/package-lock.json
3234

3335
- name: Run GoReleaser
3436
uses: goreleaser/goreleaser-action@v6
@@ -40,38 +42,12 @@ jobs:
4042
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4143
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
4244

43-
# Build Docker images in parallel (one per arch, no QEMU)
44-
docker-amd64:
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: actions/checkout@v4
48-
49-
- uses: docker/setup-buildx-action@v3
50-
51-
- uses: docker/login-action@v3
52-
with:
53-
registry: ${{ env.REGISTRY }}
54-
username: ${{ github.actor }}
55-
password: ${{ secrets.GITHUB_TOKEN }}
56-
57-
- name: Build and push amd64
58-
uses: docker/build-push-action@v6
59-
with:
60-
context: .
61-
platforms: linux/amd64
62-
push: true
63-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64
64-
cache-from: type=gha,scope=amd64
65-
cache-to: type=gha,mode=max,scope=amd64
66-
67-
docker-arm64:
45+
docker:
6846
runs-on: ubuntu-latest
6947
steps:
7048
- uses: actions/checkout@v4
7149

7250
- uses: docker/setup-qemu-action@v3
73-
with:
74-
platforms: arm64
7551

7652
- uses: docker/setup-buildx-action@v3
7753

@@ -81,36 +57,23 @@ jobs:
8157
username: ${{ github.actor }}
8258
password: ${{ secrets.GITHUB_TOKEN }}
8359

84-
- name: Build and push arm64
60+
- name: Extract metadata
61+
id: meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
65+
tags: |
66+
type=semver,pattern={{version}}
67+
type=semver,pattern={{major}}.{{minor}}
68+
type=raw,value=latest
69+
70+
- name: Build and push
8571
uses: docker/build-push-action@v6
8672
with:
8773
context: .
88-
platforms: linux/arm64
74+
platforms: linux/amd64,linux/arm64
8975
push: true
90-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
91-
cache-from: type=gha,scope=arm64
92-
cache-to: type=gha,mode=max,scope=arm64
93-
94-
# Create multi-arch manifest after both builds complete
95-
docker-manifest:
96-
runs-on: ubuntu-latest
97-
needs: [docker-amd64, docker-arm64]
98-
steps:
99-
- uses: docker/login-action@v3
100-
with:
101-
registry: ${{ env.REGISTRY }}
102-
username: ${{ github.actor }}
103-
password: ${{ secrets.GITHUB_TOKEN }}
104-
105-
- name: Create and push manifest
106-
run: |
107-
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} \
108-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 \
109-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
110-
111-
docker manifest create ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest \
112-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-amd64 \
113-
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-arm64
114-
115-
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
116-
docker manifest push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
cache-from: type=gha
79+
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)