Update Docker image workflow for multi-platform builds

This commit is contained in:
Luke Gustafson
2025-10-20 16:13:17 -05:00
committed by GitHub
parent 1a37888a4e
commit 9bbff4aa4a

View File

@@ -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 }}