diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 693d04a..7baa7d1 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -3,6 +3,8 @@ name: Build image on: push: branches: [ "main" ] + pull_request: + branches: [ "main" ] permissions: contents: read @@ -30,18 +32,24 @@ jobs: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Build and push id: docker_build uses: docker/build-push-action@v6 with: - push: true + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name == 'push' }} tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest cache-from: type=gha cache-to: type=gha,mode=max + - name: Generate artifact attestation uses: actions/attest-build-provenance@v2 + if: ${{ github.event_name == 'push' }} with: push-to-registry: true subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}