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: Check out code uses: actions/checkout@v3 - name: Set up QEMU and Buildx id: setup uses: ./.github/actions/setup with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # The majority of users running arm64 are rpi users, so the rpi # build should be the primary arm64 image - name: Build and push amd64 standard build uses: docker/build-push-action@v4 with: context: . file: docker/main/Dockerfile push: true platforms: linux/amd64 target: frigate tags: | ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-amd64 cache-from: type=gha cache-to: type=gha,mode=max - name: Build and push TensorRT (x86 GPU) uses: docker/bake-action@v3 with: push: true targets: tensorrt files: docker/tensorrt/trt.hcl set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt *.cache-from=type=gha - name: Build and push arm64 standard build uses: docker/build-push-action@v4 with: context: . file: docker/main/Dockerfile push: true platforms: linux/arm64 target: frigate tags: | ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-standard-arm64 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.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-rpi *.cache-from=type=gha - name: Build and push TensorRT (Jetson, Jetpack 4) env: ARCH: arm64 BASE_IMAGE: timongentzsch/l4t-ubuntu20-opencv:latest SLIM_BASE: timongentzsch/l4t-ubuntu20-opencv:latest TRT_BASE: timongentzsch/l4t-ubuntu20-opencv:latest uses: docker/bake-action@v3 with: push: true targets: tensorrt files: docker/tensorrt/trt.hcl set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt-jp4 *.cache-from=type=gha - name: Build and push TensorRT (Jetson, Jetpack 5) env: ARCH: arm64 BASE_IMAGE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime SLIM_BASE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime TRT_BASE: nvcr.io/nvidia/l4t-tensorrt:r8.5.2-runtime uses: docker/bake-action@v3 with: push: true targets: tensorrt files: docker/tensorrt/trt.hcl set: | tensorrt.tags=ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}-tensorrt-jp5 *.cache-from=type=gha - name: Assemble and push default build uses: int128/docker-manifest-create-action@v1 with: tags: ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }} suffixes: | -amd64 -rpi