Update docker-build-multiarch.yml
This commit is contained in:
@@ -24,10 +24,14 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
run: |
|
||||||
uses: docker/setup-buildx-action@v3
|
if docker buildx inspect multi >/dev/null 2>&1; then
|
||||||
with:
|
echo "Builder multi already exists"
|
||||||
cleanup: true
|
else
|
||||||
|
echo "Creating builder 'multi'"
|
||||||
|
docker buildx create --name multi --use
|
||||||
|
docker buildx inspect --bootstrap
|
||||||
|
fi
|
||||||
|
|
||||||
# Login to your Gitea registry
|
# Login to your Gitea registry
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
@@ -36,33 +40,3 @@ jobs:
|
|||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ secrets.REGISTRY_USER }}
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
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 }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user