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
|
2022-09-06 05:48:01 +02:00
|
|
|
# yamllint disable-line rule:truthy
|
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-09-05 08:11:46 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-09-06 05:48:01 +02:00
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
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
|