2020-07-15 22:00:53 +02:00
|
|
|
name: CI for docker images
|
|
|
|
|
|
|
|
# Only run when docker paths change
|
|
|
|
on:
|
|
|
|
push:
|
2021-07-02 15:42:36 +02:00
|
|
|
branches: [dev, beta, release]
|
2020-07-15 22:00:53 +02:00
|
|
|
paths:
|
|
|
|
- 'docker/**'
|
|
|
|
- '.github/workflows/**'
|
2021-09-20 09:29:09 +02:00
|
|
|
- 'requirements*.txt'
|
|
|
|
- 'platformio.ini'
|
2020-07-15 22:00:53 +02:00
|
|
|
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'docker/**'
|
|
|
|
- '.github/workflows/**'
|
2021-09-20 09:29:09 +02:00
|
|
|
- 'requirements*.txt'
|
|
|
|
- 'platformio.ini'
|
2020-07-15 22:00:53 +02:00
|
|
|
|
2021-10-26 10:55:27 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: read
|
|
|
|
|
2020-07-15 22:00:53 +02:00
|
|
|
jobs:
|
|
|
|
check-docker:
|
|
|
|
name: Build docker containers
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
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:
|
2021-07-15 21:30:04 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
2021-09-20 09:07:38 +02:00
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
|
2021-07-15 21:30:04 +02:00
|
|
|
- name: Set TAG
|
|
|
|
run: |
|
|
|
|
echo "TAG=check" >> $GITHUB_ENV
|
2020-07-15 22:00:53 +02:00
|
|
|
|
2021-07-15 21:30:04 +02:00
|
|
|
- name: Run build
|
|
|
|
run: |
|
|
|
|
docker/build.py \
|
|
|
|
--tag "${TAG}" \
|
|
|
|
--arch "${{ matrix.arch }}" \
|
|
|
|
--build-type "${{ matrix.build_type }}" \
|
|
|
|
build
|