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
|
|
|
|
2023-04-16 22:45:43 +02:00
|
|
|
concurrency:
|
|
|
|
# yamllint disable-line rule:line-length
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
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
|
2022-03-09 13:26:30 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Log in to docker hub
|
2023-06-09 00:39:46 +02:00
|
|
|
uses: docker/login-action@v2.2.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
|
2023-06-09 00:39:46 +02:00
|
|
|
uses: docker/login-action@v2.2.0
|
2021-07-22 01:35:08 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2022-10-25 05:14:33 +02:00
|
|
|
uses: docker/setup-qemu-action@v2.1.0
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-06-09 00:39:55 +02:00
|
|
|
uses: docker/setup-buildx-action@v2.6.0
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Build and Push
|
2023-02-08 23:53:05 +01:00
|
|
|
uses: docker/build-push-action@v4.0.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
|
2022-11-22 19:20:23 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|