Skip to content

Commit ac91f01

Browse files
properly fix docker push action
1 parent 1ca4d0e commit ac91f01

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/docker-check.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
build:
2929
name: Build Docker image
3030
runs-on: ubuntu-latest
31-
permissions: write-all
3231
needs: dockerfile-lint
3332
permissions:
3433
contents: read
@@ -53,6 +52,7 @@ jobs:
5352
provenance: false
5453

5554
- name: Log in to the Container registry
55+
if: github.event_name != 'pull_request'
5656
uses: docker/login-action@v3
5757
with:
5858
registry: ${{ env.REGISTRY }}
@@ -70,11 +70,15 @@ jobs:
7070
uses: docker/build-push-action@v6
7171
with:
7272
context: .
73-
push: true
73+
push: ${{ github.event_name != 'pull_request' }}
7474
tags: ${{ steps.meta.outputs.tags }}
7575
labels: ${{ steps.meta.outputs.labels }}
76+
cache-from: type=gha
77+
cache-to: type=gha,mode=max
78+
7679
- name: Generate artifact attestation
7780
uses: actions/attest-build-provenance@v3
81+
if: github.event_name != 'pull_request'
7882
with:
7983
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
8084
subject-digest: ${{ steps.push.outputs.digest }}

0 commit comments

Comments
 (0)