esphome-docs/.github/workflows/docker.yml
dependabot[bot] 76a87a5e04
Bump actions/checkout from 3.1.0 to 3.3.0 (#2576)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-06 08:43:11 +01:00

50 lines
1.2 KiB
YAML

name: Build Docker image
on:
workflow_dispatch:
push:
branches:
- current
paths:
- requirements.txt
- Dockerfile
- .github/workflows/docker.yml
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout source code
uses: actions/checkout@v3.3.0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
esphome/esphome-docs:latest
ghcr.io/esphome/esphome-docs:latest
cache-from: ghcr.io/esphome/esphome-docs:latest