From 9bbff4aa4a9f86f0cd4a0a99eb4f4b28a3171993 Mon Sep 17 00:00:00 2001 From: Luke Gustafson <88517757+LukeGus@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:13:17 -0500 Subject: [PATCH] Update Docker image workflow for multi-platform builds --- .github/workflows/docker-image.yml | 39 ++++++++++++++++++------------ 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index c9a747ac..f8fd51eb 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -21,7 +21,7 @@ jobs: - uses: docker/setup-qemu-action@v3 with: - platforms: arm64,arm/v7,arm/v6 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 - uses: useblacksmith/setup-docker-builder@v1 @@ -37,26 +37,33 @@ jobs: username: bugattiguy527 password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Determine Docker tags - id: tags - run: | - VERSION="${{ github.event.inputs.version }}" - PRODUCTION="${{ github.event.inputs.production }}" - if [ "$PRODUCTION" == "true" ]; then - TAGS="ghcr.io/lukegus/termix:release-$VERSION ghcr.io/lukegus/termix:latest docker.io/bugattiguy527/termix:release-$VERSION docker.io/bugattiguy527/termix:latest" - else - TAGS="ghcr.io/lukegus/termix:dev-$VERSION" - fi - echo "TAGS=$TAGS" >> $GITHUB_ENV - echo "Docker tags: $TAGS" - - - uses: useblacksmith/build-push-action@v2 + - name: Build and Push to GHCR + uses: useblacksmith/build-push-action@v2 with: context: . file: ./docker/Dockerfile push: true platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 - tags: ${{ env.TAGS }} + tags: ${{ github.event.inputs.production == 'true' && format('ghcr.io/lukegus/termix:release-{0} ghcr.io/lukegus/termix:latest', github.event.inputs.version) || format('ghcr.io/lukegus/termix:dev-{0}', github.event.inputs.version) }} + labels: | + org.opencontainers.image.source=https://github.com/${{ github.repository }} + org.opencontainers.image.revision=${{ github.sha }} + build-args: | + BUILDKIT_INLINE_CACHE=1 + BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 + outputs: type=registry,compression=zstd,compression-level=19 + + - name: Build and Push to Docker Hub + if: ${{ github.event.inputs.production == 'true' }} + uses: useblacksmith/build-push-action@v2 + with: + context: . + file: ./docker/Dockerfile + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 + tags: | + docker.io/bugattiguy527/termix:release-${{ github.event.inputs.version }} + docker.io/bugattiguy527/termix:latest labels: | org.opencontainers.image.source=https://github.com/${{ github.repository }} org.opencontainers.image.revision=${{ github.sha }}