2022-09-06 05:48:01 +02:00
|
|
|
---
|
2020-07-15 22:00:53 +02:00
|
|
|
name: CI for docker images
|
|
|
|
|
|
|
|
# Only run when docker paths change
|
2024-03-27 22:20:51 +01:00
|
|
|
|
2020-07-15 22:00:53 +02:00
|
|
|
on:
|
|
|
|
push:
|
2021-07-02 15:42:36 +02:00
|
|
|
branches: [dev, beta, release]
|
2020-07-15 22:00:53 +02:00
|
|
|
paths:
|
2022-09-06 05:48:01 +02:00
|
|
|
- "docker/**"
|
2023-09-06 05:32:14 +02:00
|
|
|
- ".github/workflows/ci-docker.yml"
|
2022-09-06 05:48:01 +02:00
|
|
|
- "requirements*.txt"
|
|
|
|
- "platformio.ini"
|
2023-04-27 02:26:06 +02:00
|
|
|
- "script/platformio_install_deps.py"
|
2020-07-15 22:00:53 +02:00
|
|
|
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2022-09-06 05:48:01 +02:00
|
|
|
- "docker/**"
|
2023-09-06 05:32:14 +02:00
|
|
|
- ".github/workflows/ci-docker.yml"
|
2022-09-06 05:48:01 +02:00
|
|
|
- "requirements*.txt"
|
|
|
|
- "platformio.ini"
|
2023-04-27 02:26:06 +02:00
|
|
|
- "script/platformio_install_deps.py"
|
2020-07-15 22:00:53 +02:00
|
|
|
|
2021-10-26 10:55:27 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: read
|
|
|
|
|
2023-02-14 00:07:09 +01:00
|
|
|
concurrency:
|
|
|
|
# yamllint disable-line rule:line-length
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-07-15 22:00:53 +02:00
|
|
|
jobs:
|
|
|
|
check-docker:
|
|
|
|
name: Build docker containers
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-09-20 21:54:35 +02:00
|
|
|
fail-fast: false
|
2020-07-15 22:00:53 +02:00
|
|
|
matrix:
|
|
|
|
arch: [amd64, armv7, aarch64]
|
2021-07-15 21:30:04 +02:00
|
|
|
build_type: ["ha-addon", "docker", "lint"]
|
2020-07-15 22:00:53 +02:00
|
|
|
steps:
|
2023-10-19 02:08:15 +02:00
|
|
|
- uses: actions/checkout@v4.1.1
|
2022-09-06 05:48:01 +02:00
|
|
|
- name: Set up Python
|
2024-04-01 01:41:43 +02:00
|
|
|
uses: actions/setup-python@v5.1.0
|
2022-09-06 05:48:01 +02:00
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
- name: Set up Docker Buildx
|
2024-03-15 00:42:38 +01:00
|
|
|
uses: docker/setup-buildx-action@v3.2.0
|
2022-09-06 05:48:01 +02:00
|
|
|
- name: Set up QEMU
|
2023-09-13 00:06:32 +02:00
|
|
|
uses: docker/setup-qemu-action@v3.0.0
|
2021-09-20 09:07:38 +02:00
|
|
|
|
2022-09-06 05:48:01 +02:00
|
|
|
- name: Set TAG
|
|
|
|
run: |
|
|
|
|
echo "TAG=check" >> $GITHUB_ENV
|
2020-07-15 22:00:53 +02:00
|
|
|
|
2022-09-06 05:48:01 +02:00
|
|
|
- name: Run build
|
|
|
|
run: |
|
|
|
|
docker/build.py \
|
|
|
|
--tag "${TAG}" \
|
|
|
|
--arch "${{ matrix.arch }}" \
|
|
|
|
--build-type "${{ matrix.build_type }}" \
|
|
|
|
build
|