Skip to content

Commit

Permalink
CI: Update image release workflow with multi-arch support
Browse files Browse the repository at this point in the history
This updates the `latest` image we provide to support both amd64 and
arm64 architectures within the same image.
  • Loading branch information
omeryusufyagci committed Dec 11, 2024
1 parent 5c1677a commit 972411c
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/build_and_publish_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,22 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Required for cross-platform builds with buildx to emulate foreign archs
- name: Enable QEMU Emulation
uses: docker/setup-qemu-action@v2

# Required for multi-arch image
- name: Enable Buildx for Multi-Platform
uses: docker/setup-buildx-action@v2

- name: Verify Buildx and QEMU
run: |
docker buildx version
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
uname -m
- name: Build and Push Docker Image for Linux (amd64)
if: github.event_name == 'push'
# Build and Push Multi-Arch Image:
# Thanks to buildx, this image works for both archs (amd64/arm64)
# Docker resolves the arch per platform for us, via the manifest
- name: Build and Push Multi-Arch Image
run: |
docker buildx build \
--platform linux/amd64 \
--platform linux/amd64,linux/arm64 \
--no-cache \
--tag ghcr.io/${{ github.repository_owner }}/fast-music-remover:latest \
--push \
.
- name: Build Docker Image for macOS Test (amd64 workaround)
if: github.event_name == 'pull_request'
run: |
docker buildx build \
--platform linux/amd64 \
--tag ghcr.io/${{ github.repository_owner }}/fast-music-remover:macos-test \
--output=type=docker \
.

0 comments on commit 972411c

Please sign in to comment.