Skip to content

Commit 89feed6

Browse files
committed
Allow Docker to build (but not push) on CI for PRs
1 parent 55106e9 commit 89feed6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ jobs:
3737
name: Build and push image
3838
runs-on: ubuntu-latest
3939
needs: [format, lint, type-check]
40-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
4140
permissions:
4241
contents: read
4342
packages: write
4443
steps:
4544
- uses: actions/checkout@v6
4645

4746
- name: Log in to GHCR
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
4848
uses: docker/login-action@v4
4949
with:
5050
registry: ghcr.io
@@ -64,6 +64,6 @@ jobs:
6464
uses: docker/build-push-action@v7
6565
with:
6666
context: .
67-
push: true
67+
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
6868
tags: ${{ steps.meta.outputs.tags }}
6969
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)