diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 6a50a3965..423655f18 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,8 +4,10 @@ inputs: GITHUB_TOKEN: required: true outputs: - lowercase-repo: - value: ${{ steps.lowercaseRepo.outputs.lowercase }} + image-name: + value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }} + cache-name: + value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache runs: using: "composite" steps: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91e905a2d..253be03db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,10 +34,9 @@ jobs: 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,compression=zstd + tags: ${{ steps.setup.outputs.image-name }}-amd64 + cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64 + cache-to: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max,compression=zstd - name: Build and push TensorRT (x86 GPU) uses: docker/bake-action@v3 with: @@ -45,8 +44,7 @@ jobs: 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 + tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt arm64_build: runs-on: ubuntu-latest name: ARM Build @@ -67,9 +65,9 @@ jobs: 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,compression=zstd + ${{ steps.setup.outputs.image-name }}-standard-arm64 + cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-standard-arm64 + cache-to: type=registry,ref=${{ steps.setup.outputs.cache-name }}-standard-arm64,mode=max,compression=zstd - name: Build and push RPi build uses: docker/bake-action@v3 with: @@ -77,8 +75,7 @@ jobs: 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 + rpi.tags=${{ steps.setup.outputs.image-name }}-rpi jetson_jp4_build: runs-on: ubuntu-latest name: Jetson Jetpack 4 @@ -102,9 +99,9 @@ jobs: 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 - *.cache-to=type=gha,mode=max,compression=zstd + tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp4 + *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt-jp4 + *.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt-jp4,mode=max,compression=zstd jetson_jp5_build: runs-on: ubuntu-latest name: Jetson Jetpack 5 @@ -128,9 +125,9 @@ jobs: 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 - *.cache-to=type=gha,mode=max,compression=zstd + tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp5 + *.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt-jp5 + *.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt-jp5,mode=max,compression=zstd # The majority of users running arm64 are rpi users, so the rpi # build should be the primary arm64 image assemble_default_build: @@ -154,7 +151,7 @@ jobs: run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV - uses: int128/docker-manifest-create-action@v1 with: - tags: ghcr.io/${{ steps.setup.outputs.lowercase-repo }}:${{ github.ref_name }}-${{ env.SHORT_SHA }} + tags: ${{ steps.setup.outputs.image-name }} suffixes: | -amd64 -rpi