Skip to content

Commit e985371

Browse files
authored
Build docker image on PRs that touch the docker files (#4374)
1 parent d603297 commit e985371

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.github/workflows/docker.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ on:
99
- requirements.txt
1010
- Dockerfile
1111
- .github/workflows/docker.yml
12+
pull_request:
13+
paths:
14+
- requirements.txt
15+
- Dockerfile
16+
- .github/workflows/docker.yml
1217

1318
permissions:
1419
contents: read
@@ -34,11 +39,13 @@ jobs:
3439
uses: docker/setup-buildx-action@v3
3540
-
3641
name: Login to DockerHub
42+
if: github.event_name != 'pull_request'
3743
uses: docker/login-action@v3
3844
with:
3945
username: ${{ secrets.DOCKER_USER }}
4046
password: ${{ secrets.DOCKER_PASSWORD }}
4147
- name: Login to GitHub Container Registry
48+
if: github.event_name != 'pull_request'
4249
uses: docker/login-action@v3
4350
with:
4451
registry: ghcr.io
@@ -50,7 +57,7 @@ jobs:
5057
uses: docker/build-push-action@v6
5158
with:
5259
context: .
53-
push: true
60+
push: ${{ github.event_name != 'pull_request' }}
5461
platforms: linux/amd64,linux/arm64
5562
tags: |
5663
esphome/esphome-docs:latest

0 commit comments

Comments
 (0)