fix(ci): add QEMU setup for multi-arch builds and skip for PRs
- Add docker/setup-qemu-action for proper ARM64 emulation - Skip QEMU setup for PR builds (amd64 only) - Fix QEMU "Illegal instruction" errors during npm ci
This commit is contained in:
@@ -49,14 +49,20 @@ jobs:
|
|||||||
# For main/develop/tags, build multi-arch
|
# For main/develop/tags, build multi-arch
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
|
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
|
||||||
|
echo "skip_qemu=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
||||||
|
echo "skip_qemu=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: steps.platforms.outputs.skip_qemu != 'true'
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
platforms: ${{ steps.platforms.outputs.platforms }}
|
|
||||||
|
|
||||||
- name: Log in to Container Registry
|
- name: Log in to Container Registry
|
||||||
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
||||||
@@ -140,14 +146,20 @@ jobs:
|
|||||||
# For main/develop/tags, build multi-arch
|
# For main/develop/tags, build multi-arch
|
||||||
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
|
echo "platforms=linux/amd64" >> $GITHUB_OUTPUT
|
||||||
|
echo "skip_qemu=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
echo "platforms=linux/amd64,linux/arm64" >> $GITHUB_OUTPUT
|
||||||
|
echo "skip_qemu=false" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
if: steps.platforms.outputs.skip_qemu != 'true'
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: arm64
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
platforms: ${{ steps.platforms.outputs.platforms }}
|
|
||||||
|
|
||||||
- name: Log in to Container Registry
|
- name: Log in to Container Registry
|
||||||
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
if: github.event_name != 'pull_request' || github.event.inputs.push == 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user