@@ -153,7 +153,7 @@ jobs:
153
153
platforms : arm64
154
154
- name : Login to GitHub Container Registry
155
155
uses : docker/login-action@v2
156
- if : ${{ startsWith( github.ref, 'refs/tags') }}
156
+ if : ${{ github.event_name != 'pull_request' }}
157
157
with :
158
158
registry : ghcr.io
159
159
username : ${{ github.repository_owner }}
@@ -168,19 +168,21 @@ jobs:
168
168
type=semver,pattern={{version}}
169
169
type=edge
170
170
type=ref,event=pr
171
- type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
171
+ type=ref,event=branch,suffix=-rc, enable=${{ startsWith(github.ref, 'refs/heads/release') }}
172
172
- name : Build Docker Image
173
173
uses : docker/build-push-action@v3
174
174
with :
175
175
file : build/Dockerfile
176
176
context : ' .'
177
177
target : goreleaser
178
178
tags : ${{ steps.meta.outputs.tags }}
179
- load : ${{ !startsWith( github.ref, 'refs/tags') }}
180
- push : ${{ startsWith( github.ref, 'refs/tags') }}
181
- platforms : ${{ startsWith( github.ref, 'refs/tags') && env.platforms || '' }}
179
+ load : ${{ github.event_name == 'pull_request' }}
180
+ push : ${{ github.event_name != 'pull_request' }}
181
+ platforms : ${{ github.event_name != 'pull_request' && env.platforms || '' }}
182
182
cache-from : type=gha
183
183
cache-to : type=gha,mode=max
184
+ pull : true
185
+ no-cache : ${{ github.event_name != 'pull_request' }}
184
186
build-args : |
185
187
VERSION=${{ needs.vars.outputs.version }}
186
188
GIT_COMMIT=${{ needs.vars.outputs.sha }}
0 commit comments