diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0f144be..beadb8b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -24,8 +24,7 @@ on: required: true env: - # github.repository as / - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: jgosmann/dmarc-metrics-exporter jobs: @@ -42,12 +41,18 @@ jobs: run: REF=${{ inputs.version }}; TAG=${REF#refs/*/}; echo "version=${TAG#v}" >> $GITHUB_OUTPUT - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -56,17 +61,18 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.IMAGE_NAME }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: . push: ${{ github.event_name != 'pull_request' }} - tags: jgosmann/dmarc-metrics-exporter:${{ steps.version.outputs.version }} + tags: ${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }} + platforms: linux/amd64,linux/arm64 labels: ${{ steps.meta.outputs.labels }} build-args: "version=${{ steps.version.outputs.version }}" diff --git a/Dockerfile b/Dockerfile index 837d432..b4e923e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.11-slim AS builder +FROM --platform=linux/amd64 python:3.11-slim AS builder ARG version # install python package in venv