2021-07-22 01:35:08 +02:00
|
|
|
name: Build docker image on changes
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- Dockerfile
|
|
|
|
- requirements_test.txt
|
2021-07-22 02:32:37 +02:00
|
|
|
- .github/workflows/docker.yml
|
2021-07-22 01:35:08 +02:00
|
|
|
|
2021-10-23 21:57:46 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
2021-07-22 01:35:08 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-image:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Build and push Docker image
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout source code
|
|
|
|
uses: actions/checkout@v2.3.4
|
|
|
|
-
|
|
|
|
name: Log in to docker hub
|
2021-12-22 01:59:40 +01:00
|
|
|
uses: docker/login-action@v1.12.0
|
2021-07-22 01:35:08 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
-
|
|
|
|
name: Log in to the GitHub container registry
|
2021-12-22 01:59:40 +01:00
|
|
|
uses: docker/login-action@v1.12.0
|
2021-07-22 01:35:08 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1.2.0
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2021-09-08 21:31:21 +02:00
|
|
|
uses: docker/setup-buildx-action@v1.6.0
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Build and Push
|
2021-08-23 17:01:47 +02:00
|
|
|
uses: docker/build-push-action@v2.7.0
|
2021-07-22 01:35:08 +02:00
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
tags: |
|
|
|
|
ghcr.io/esphome/aioesphomeapi-proto-builder:latest
|
|
|
|
esphome/aioesphomeapi-proto-builder:latest
|
|
|
|
push: true
|
|
|
|
pull: true
|
2021-07-26 01:35:29 +02:00
|
|
|
cache-to: type=inline
|
2021-07-22 02:32:37 +02:00
|
|
|
cache-from: ghcr.io/esphome/aioesphomeapi-proto-builder:latest
|
2021-07-22 01:35:08 +02:00
|
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|