Skip to content

Commit b3cf6c9

Browse files
committed
Added Docker image compilation when a pull request is merged
1 parent 8141213 commit b3cf6c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/docker-image.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ name: Docker Image CI
33
on:
44
push:
55
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
86
schedule:
97
- cron: 0 6 * * 1
8+
pull_request:
109
workflow_dispatch:
1110

1211
jobs:
@@ -37,17 +36,18 @@ jobs:
3736
tags: |
3837
type=sha
3938
- name: Login to GitHub Container Registry
40-
if: github.event_name != 'pull_request'
39+
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.action == 'opened' && github.event.pull_request.merged == 'true' )
4140
uses: docker/login-action@v3
4241
with:
4342
registry: ghcr.io
4443
username: ${{ github.actor }}
4544
password: ${{ secrets.GITHUB_TOKEN }}
4645
- name: Build Docker Image and push
47-
uses: docker/build-push-action@v6
46+
if: github.event_name == 'push' || ( github.event_name == 'pull_request' && github.event.action == 'opened' && github.event.pull_request.merged == 'true' )
47+
uses: docker/build-push-action@v5
4848
with:
4949
file: docker/Dockerfile.development
50-
push: ${{ github.event_name == 'push' }}
50+
push: true
5151
tags: ${{ steps.meta.outputs.tags }}
5252
labels: ${{ steps.meta.outputs.labels }}
5353
context: .

0 commit comments

Comments
 (0)