Skip to content

govee

govee #89

name: diyHue CI Build
on:
push:
jobs:
build:
runs-on: ubuntu-latest
name: Build Docker Image
strategy:
matrix:
include:
- arch: linux/amd64
arch_friendly: amd64
- arch: linux/arm/v7
arch_friendly: armv7
- arch: linux/arm64
arch_friendly: arm64
- arch: linux/arm/v6
arch_friendly: armv6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable qemu
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Build docker image
run: |
docker build -t diyhue/diyhue:ci -f ./.build/Dockerfile --platform=${{ matrix.arch }} --build-arg TARGETPLATFORM=${{ matrix.arch }} .
- name: Save tarball
run: |
docker save --output output.tar diyhue/diyhue:ci
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ci-${{ matrix.arch_friendly }}-${{ github.run_number }}.tar
path: output.tar
test:
needs: [build]
runs-on: ubuntu-latest
name: Test Image
strategy:
matrix:
arch: [amd64, armv7, arm64, armv6]
steps:
- name: Enable qemu
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Download container artifact
uses: actions/download-artifact@v4
with:
name: ci-${{ matrix.arch }}-${{ github.run_number }}.tar
- name: Import image
run: |
docker load --input output.tar
- name: Run docker image
if: success()
run: |
docker run -d --name diyhue --network=host -v /mnt/hue-emulator/export:/opt/hue-emulator/export -e MAC=b8:27:eb:d4:dc:11 -e IP=192.168.1.123 -e DEBUG=true diyhue/diyhue:ci
sleep 15
docker logs diyhue
- name: Cleanup
run: |
docker kill diyhue
docker rm diyhue
cleanup_failed:
needs: [build, test]
if: failure()
name: Delete failed artifacts
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, armv7, arm64, armv6]
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ci-${{ matrix.arch }}-${{ github.run_number }}.tar