blakeblackshear.frigate/.github/workflows/ci.yml
Nicolas Mowen dc44a6c3b4
Community Supported Boards Framework (#7114)
* Make main frigate build non rpi specific and build rpi using base image

* Add boards to sidebar

* Fix docker build

* Fix docs build

* Update pr branch for testing

* remove target from rpi build

* Remove manual build

* Add push build for rpi

* fix typos, improve wording

* Add arm build for rpi

* Cleanup and add default github ref name

* Cleanup docker build file system

* Setup to use docker bake

* Add ci/cd for bake

* Fix path

* Fix devcontainer

* Set targets

* Fix build

* Fix syntax

* Add wheels target

* Move dev container to trt

* Update key and fix rpi local

* Move requirements files and set intermediate targets

* Add back --load

* Update docs for community board development

* Update installation docs to reflect different builds available

* Update docs with official and community supported headers

* Update codeowners docs

* Update docs

* Assemble main and standard builds

* Change order of pushes

* Remove community board after successful build

* Fix rpi bake file names
2023-07-23 16:45:29 -05:00

91 lines
3.0 KiB
YAML

name: CI
on:
push:
branches:
- dev
- master
# only run the latest commit to avoid cache overwrites
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: 3.9
jobs:
multi_arch_build:
runs-on: ubuntu-latest
name: Image Build
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.repository }}
- name: Check out code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create version file
run: make version
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
- uses: docker/metadata-action@v4
id: metadata
with:
images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
# avoid overwriting the latest tag because metadata-action does not add a suffix to it
flavor: latest=false,suffix=-${{ matrix.platform }}
# The majority of users running arm64 are rpi users, so the rpi
# build should be the primary arm64 image
- name: Build and push standard build
uses: docker/build-push-action@v4
with:
context: .
file: docker/main/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
target: frigate
tags: |
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push RPi build
uses: docker/bake-action@v3
with:
push: true
targets: rpi
files: docker/rpi/rpi.hcl
set: |
rpi.tags=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-rpi
*.cache-from=type=gha
- name: Build and push TensorRT
uses: docker/bake-action@v3
with:
push: true
targets: tensorrt
files: docker/tensorrt/trt.hcl
set: |
tensorrt.tags=ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt
*.cache-from=type=gha
- name: Assemble and push default build
uses: int128/docker-manifest-create-action@v1
with:
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
suffixes: |
-amd64
-rpi