esphome-docs/.github/workflows/docker.yml
dependabot[bot] ce6cb2a782
Bump jaxxstorm/action-install-gh-release from 1.13.0 to 1.14.0 (#4470)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 10:51:35 +01:00

66 lines
1.7 KiB
YAML

name: Build Docker image
on:
workflow_dispatch:
push:
branches:
- current
paths:
- requirements.txt
- Dockerfile
- .github/workflows/docker.yml
pull_request:
paths:
- requirements.txt
- Dockerfile
- .github/workflows/docker.yml
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Install pagefind
uses: jaxxstorm/action-install-gh-release@v1.14.0
with:
repo: cloudcannon/pagefind
-
name: Checkout source code
uses: actions/checkout@v4.2.2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
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
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64
tags: |
esphome/esphome-docs:latest
ghcr.io/esphome/esphome-docs:latest
cache-from: ghcr.io/esphome/esphome-docs:latest