Skip to content

Commit ee9d24b

Browse files
authored
Enable pushing edge images (#186)
1 parent dd69d57 commit ee9d24b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
platforms: arm64
154154
- name: Login to GitHub Container Registry
155155
uses: docker/login-action@v2
156-
if: ${{ startsWith(github.ref, 'refs/tags') }}
156+
if: ${{ github.event_name != 'pull_request' }}
157157
with:
158158
registry: ghcr.io
159159
username: ${{ github.repository_owner }}
@@ -168,19 +168,21 @@ jobs:
168168
type=semver,pattern={{version}}
169169
type=edge
170170
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') }}
172172
- name: Build Docker Image
173173
uses: docker/build-push-action@v3
174174
with:
175175
file: build/Dockerfile
176176
context: '.'
177177
target: goreleaser
178178
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 || '' }}
182182
cache-from: type=gha
183183
cache-to: type=gha,mode=max
184+
pull: true
185+
no-cache: ${{ github.event_name != 'pull_request' }}
184186
build-args: |
185187
VERSION=${{ needs.vars.outputs.version }}
186188
GIT_COMMIT=${{ needs.vars.outputs.sha }}

0 commit comments

Comments
 (0)