Skip to content

Commit 505d912

Browse files
authored
Build image on pull request
1 parent 2496fb8 commit 505d912

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/build-docker.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
name: Docker Build & Publish to GitHub Container Registry
44
on:
5+
pull_request:
56
push:
67
branches:
78
- 'main'
@@ -40,9 +41,9 @@ jobs:
4041
- name: Build and Push Latest Docker Image
4142
id: build-and-push-latest
4243
uses: docker/build-push-action@v2
43-
if: ${{ github.ref == 'refs/heads/main' }}
44+
if: ${{ github.ref_type == 'branch' }}
4445
with:
4546
context: .
46-
push: true
47+
push: ${{ github.ref == 'refs/heads/main' }}
4748
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
4849
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)