Skip to content

Commit 2b9bcbb

Browse files
committed
CI: build on PRs, push only from master
1 parent 788e26a commit 2b9bcbb

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/docker.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ name: "Docker"
33
on:
44
workflow_dispatch:
55

6+
pull_request:
7+
68
push:
7-
branches: ["master"]
89

910
schedule:
1011
- cron: "0 8 * * 1"
@@ -74,7 +75,7 @@ jobs:
7475
uses: docker/setup-buildx-action@v3
7576

7677
- name: Login to DockerHub
77-
if: github.ref == 'refs/heads/master'
78+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
7879
uses: docker/login-action@v3
7980
with:
8081
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -104,7 +105,7 @@ jobs:
104105
docker stop $CONTAINER_ID
105106
106107
- name: Build and push to registry
107-
if: github.ref == 'refs/heads/master'
108+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
108109
uses: docker/build-push-action@v6
109110
with:
110111
context: ${{ matrix.context }}

0 commit comments

Comments
 (0)