diff --git a/.github/workflows/container-image.yaml b/.github/workflows/container-image.yaml index 0517b070..888ccb0a 100644 --- a/.github/workflows/container-image.yaml +++ b/.github/workflows/container-image.yaml @@ -35,6 +35,12 @@ jobs: with: images: ghcr.io/${{ env.REPO }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry if: github.event_name != 'pull_request' uses: docker/login-action@v3 @@ -43,16 +49,17 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image + - name: Build amd64 Docker image for scan + if: github.event_name == 'pull_request' uses: docker/build-push-action@v6 with: context: . - load: ${{ github.event_name == 'pull_request' }} - push: ${{ github.event_name != 'pull_request' }} + load: true + push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: Scan image + - name: Scan amd64 image if: github.event_name == 'pull_request' uses: aquasecurity/trivy-action@0.30.0 id: scan @@ -61,3 +68,13 @@ jobs: exit-code: '1' ignore-unfixed: true severity: 'HIGH,CRITICAL' + + - name: Build and push multiplatform Docker image + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}