Update docker-build-multiarch.yml

This commit is contained in:
2025-11-02 10:24:48 -08:00
parent ed40fe3920
commit 79a0585daf

View File

@@ -24,10 +24,14 @@ jobs:
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
cleanup: true
run: |
if docker buildx inspect multi >/dev/null 2>&1; then
echo "Builder multi already exists"
else
echo "Creating builder 'multi'"
docker buildx create --name multi --use
docker buildx inspect --bootstrap
fi
# Login to your Gitea registry
- name: Log in to registry
@@ -36,33 +40,3 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
# Optional: derive tags/labels from repo metadata
# Comment out if you prefer static tags only
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ env.TAG_NAME }}
type=raw,value=sha-${{ github.sha }}
flavor: |
latest=false
- name: Build and push (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
platforms: ${{ env.PLATFORMS }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
# Optional: print the final manifest list for verification
- name: Inspect pushed manifest
run: |
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.TAG_NAME }}