Skip to content

Commit b28efb9

Browse files
committed
only build x86 unless release
1 parent dddaa21 commit b28efb9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,20 @@ jobs:
4242
registry: ghcr.io
4343
username: ${{ github.repository_owner }}
4444
password: ${{ secrets.GITHUB_TOKEN }}
45-
- name: Build and push
46-
uses: docker/build-push-action@v2
45+
# Build the Docker image for all events, but do not push
46+
# We use linux/amd64 for the build only as it's faster on GitHub Actions
47+
- name: Build image
48+
uses: docker/build-push-action@v5
49+
with:
50+
context: .
51+
platforms: linux/amd64
52+
push: false
53+
tags: ${{ steps.meta.outputs.tags }}
54+
labels: ${{ steps.meta.outputs.labels }}
55+
# Push the Docker image only when a GitHub Release is published
56+
- name: Push image
57+
if: github.event_name == 'release' && github.event.action == 'published'
58+
uses: docker/build-push-action@v5
4759
with:
4860
context: .
4961
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)