From 4872ef71f8b3c6aad9c95b6f5d3631efd87eecd3 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Thu, 8 Jan 2026 11:33:20 +0100 Subject: [PATCH] ci: only build ARM64 images for tagged releases QEMU emulation of ARM64 on x86 GitHub runners is too slow and unreliable for npm operations, causing builds to hang or crash with "Illegal instruction" errors. Changed platform detection logic to: - Tagged releases (v*.*.*): Build both amd64 and arm64 - All other builds (branches, PRs): Build amd64 only This ensures fast CI feedback during development while still providing multi-arch images for production releases. --- .github/workflows/docker-build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 23dc13c0..faa24054 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -45,14 +45,14 @@ jobs: - name: Determine build platforms id: platforms run: | - # For PRs, build only amd64 to avoid QEMU emulation issues with Sharp - # For main/develop/tags, build multi-arch - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "platforms=linux/amd64" >> $GITHUB_OUTPUT - echo "skip_qemu=true" >> $GITHUB_OUTPUT - else + # Only build ARM64 for tagged releases (v*.*.*) + # QEMU emulation is too slow/unreliable for npm operations on regular builds + if [[ "${{ github.ref }}" == refs/tags/v* ]]; then echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT echo "skip_qemu=false" >> $GITHUB_OUTPUT + else + echo "platforms=linux/amd64" >> $GITHUB_OUTPUT + echo "skip_qemu=true" >> $GITHUB_OUTPUT fi - name: Set up QEMU @@ -142,14 +142,14 @@ jobs: - name: Determine build platforms id: platforms run: | - # For PRs, build only amd64 to avoid QEMU emulation issues - # For main/develop/tags, build multi-arch - if [[ "${{ github.event_name }}" == "pull_request" ]]; then - echo "platforms=linux/amd64" >> $GITHUB_OUTPUT - echo "skip_qemu=true" >> $GITHUB_OUTPUT - else + # Only build ARM64 for tagged releases (v*.*.*) + # QEMU emulation is too slow/unreliable for npm operations on regular builds + if [[ "${{ github.ref }}" == refs/tags/v* ]]; then echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT echo "skip_qemu=false" >> $GITHUB_OUTPUT + else + echo "platforms=linux/amd64" >> $GITHUB_OUTPUT + echo "skip_qemu=true" >> $GITHUB_OUTPUT fi - name: Set up QEMU