esphome-docs/.github/workflows/docker.yml
Jesse Hills 42f27b98a2
Explicit action versions
Login and push to ghcr too
2021-07-15 13:24:36 +12:00

46 lines
1.1 KiB
YAML

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