Skip to content

Commit 62d188f

Browse files
Copilottma
andcommitted
fix: avoid ghcr push on pr builds
Co-authored-by: tma <4719+tma@users.noreply.github.com>
1 parent c3f1356 commit 62d188f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/docker.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,25 @@ jobs:
4747
type=semver,pattern={{major}}.{{minor}}
4848
type=semver,pattern={{major}}
4949
50+
- name: Build image
51+
if: github.event_name == 'pull_request'
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: .
55+
platforms: linux/amd64,linux/arm64
56+
push: false
57+
tags: ${{ steps.meta.outputs.tags }}
58+
labels: ${{ steps.meta.outputs.labels }}
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max
61+
5062
- name: Build and push
63+
if: github.event_name != 'pull_request'
5164
uses: docker/build-push-action@v6
5265
with:
5366
context: .
5467
platforms: linux/amd64,linux/arm64
55-
push: ${{ github.event_name != 'pull_request' }}
68+
push: true
5669
tags: ${{ steps.meta.outputs.tags }}
5770
labels: ${{ steps.meta.outputs.labels }}
5871
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache

0 commit comments

Comments
 (0)