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
|
2023-09-25 00:04:02 +02:00
|
|
|
uses: actions/checkout@v4
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Log in to docker hub
|
2023-09-24 23:40:36 +02:00
|
|
|
uses: docker/login-action@v3.0.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-09-24 23:40:36 +02:00
|
|
|
uses: docker/login-action@v3.0.0
|
2021-07-22 01:35:08 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
2023-09-24 23:39:12 +02:00
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2023-10-02 11:04:55 +02:00
|
|
|
uses: docker/setup-buildx-action@v3.0.0
|
2021-07-22 01:35:08 +02:00
|
|
|
-
|
|
|
|
name: Build and Push
|
2023-09-24 23:31:19 +02:00
|
|
|
uses: docker/build-push-action@v5.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
|