Skip to content

Commit

Permalink
Build docker image on PRs that touch the docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
jesserockz committed Oct 23, 2024
1 parent 1aa6f36 commit ec19deb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
- requirements.txt
- Dockerfile
- .github/workflows/docker.yml
pull_request:
paths:
- requirements.txt
- Dockerfile
- .github/workflows/docker.yml

permissions:
contents: read
Expand All @@ -34,11 +39,13 @@ jobs:
uses: docker/setup-buildx-action@v3
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -50,7 +57,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
push: true
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: |
esphome/esphome-docs:latest
Expand Down

0 comments on commit ec19deb

Please sign in to comment.