2021-07-15 03:03:08 +02:00
|
|
|
name: Build Docker image
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- current
|
|
|
|
paths:
|
|
|
|
- requirements.txt
|
|
|
|
- Dockerfile
|
|
|
|
- .github/workflows/docker.yml
|
|
|
|
|
2021-10-23 21:57:26 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
2021-07-15 03:03:08 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout source code
|
2023-10-11 02:04:35 +02:00
|
|
|
uses: actions/checkout@v4.1.0
|
2021-07-15 03:03:08 +02:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-10-11 02:04:14 +02:00
|
|
|
uses: docker/setup-buildx-action@v3
|
2021-07-15 03:03:08 +02:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
2023-10-11 02:06:10 +02:00
|
|
|
uses: docker/login-action@v3
|
2021-07-15 03:03:08 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
2021-07-15 03:24:36 +02:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-10-11 02:06:10 +02:00
|
|
|
uses: docker/login-action@v3
|
2021-07-15 03:24:36 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-15 03:03:08 +02:00
|
|
|
-
|
|
|
|
name: Build and push
|
|
|
|
id: docker_build
|
2023-10-11 02:04:19 +02:00
|
|
|
uses: docker/build-push-action@v5
|
2021-07-15 03:03:08 +02:00
|
|
|
with:
|
2021-07-15 03:11:57 +02:00
|
|
|
context: .
|
2021-07-15 03:03:08 +02:00
|
|
|
push: true
|
2021-07-15 03:24:36 +02:00
|
|
|
tags: |
|
|
|
|
esphome/esphome-docs:latest
|
|
|
|
ghcr.io/esphome/esphome-docs:latest
|
|
|
|
cache-from: ghcr.io/esphome/esphome-docs:latest
|