mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-05 17:51:36 +02:00
Add docker metadata - fixes #19618
This commit is contained in:
parent
b781f06f9c
commit
130485d679
16
.github/actions/setup/action.yml
vendored
16
.github/actions/setup/action.yml
vendored
@ -3,9 +3,14 @@ description: 'Set up QEMU and Buildx'
|
|||||||
inputs:
|
inputs:
|
||||||
GITHUB_TOKEN:
|
GITHUB_TOKEN:
|
||||||
required: true
|
required: true
|
||||||
|
tag-suffix:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
outputs:
|
outputs:
|
||||||
image-name:
|
image-tags:
|
||||||
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ steps.create-short-sha.outputs.SHORT_SHA }}
|
value: ${{ steps.meta.outputs.tags }}
|
||||||
|
image-labels:
|
||||||
|
value: ${{ steps.meta.outputs.labels }}
|
||||||
cache-name:
|
cache-name:
|
||||||
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
|
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
|
||||||
runs:
|
runs:
|
||||||
@ -48,3 +53,10 @@ runs:
|
|||||||
- id: create-short-sha
|
- id: create-short-sha
|
||||||
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
|
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
# list of Docker images to use as base name for tags
|
||||||
|
images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}
|
||||||
|
tags: type=raw,value=${{ steps.create-short-sha.outputs.SHORT_SHA }}${{ inputs.tag-suffix }}
|
||||||
|
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -31,6 +31,7 @@ jobs:
|
|||||||
uses: ./.github/actions/setup
|
uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag-suffix: "-amd64"
|
||||||
- name: Build and push amd64 standard build
|
- name: Build and push amd64 standard build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
@ -39,7 +40,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
target: frigate
|
target: frigate
|
||||||
tags: ${{ steps.setup.outputs.image-name }}-amd64
|
labels: ${{ steps.setup.outputs.image-labels }}
|
||||||
|
tags: ${{ steps.setup.outputs.image-tags }}
|
||||||
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-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
|
cache-to: type=registry,ref=${{ steps.setup.outputs.cache-name }}-amd64,mode=max
|
||||||
arm64_build:
|
arm64_build:
|
||||||
@ -63,8 +65,8 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
target: frigate
|
target: frigate
|
||||||
tags: |
|
labels: ${{ steps.setup.outputs.image-labels }}
|
||||||
${{ steps.setup.outputs.image-name }}-standard-arm64
|
tags: ${{ steps.setup.outputs.image-tags }}-standard-arm64
|
||||||
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
|
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
|
||||||
- name: Build and push RPi build
|
- name: Build and push RPi build
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v6
|
||||||
@ -74,9 +76,9 @@ jobs:
|
|||||||
targets: rpi
|
targets: rpi
|
||||||
files: docker/rpi/rpi.hcl
|
files: docker/rpi/rpi.hcl
|
||||||
set: |
|
set: |
|
||||||
rpi.tags=${{ steps.setup.outputs.image-name }}-rpi
|
rpi.tags=${{ steps.setup.outputs.image-tags }}-rpi
|
||||||
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rpi
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rpi,mode=max
|
||||||
jetson_jp6_build:
|
jetson_jp6_build:
|
||||||
runs-on: ubuntu-22.04-arm
|
runs-on: ubuntu-22.04-arm
|
||||||
name: Jetson Jetpack 6
|
name: Jetson Jetpack 6
|
||||||
@ -103,7 +105,7 @@ jobs:
|
|||||||
targets: tensorrt
|
targets: tensorrt
|
||||||
files: docker/tensorrt/trt.hcl
|
files: docker/tensorrt/trt.hcl
|
||||||
set: |
|
set: |
|
||||||
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt-jp6
|
tensorrt.tags=${{ steps.setup.outputs.image-tags }}-tensorrt-jp6
|
||||||
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-jp6,mode=max
|
||||||
amd64_extra_builds:
|
amd64_extra_builds:
|
||||||
@ -131,7 +133,7 @@ jobs:
|
|||||||
targets: tensorrt
|
targets: tensorrt
|
||||||
files: docker/tensorrt/trt.hcl
|
files: docker/tensorrt/trt.hcl
|
||||||
set: |
|
set: |
|
||||||
tensorrt.tags=${{ steps.setup.outputs.image-name }}-tensorrt
|
tensorrt.tags=${{ steps.setup.outputs.image-tags }}-tensorrt
|
||||||
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-tensorrt,mode=max
|
||||||
- name: AMD/ROCm general build
|
- name: AMD/ROCm general build
|
||||||
@ -145,7 +147,7 @@ jobs:
|
|||||||
targets: rocm
|
targets: rocm
|
||||||
files: docker/rocm/rocm.hcl
|
files: docker/rocm/rocm.hcl
|
||||||
set: |
|
set: |
|
||||||
rocm.tags=${{ steps.setup.outputs.image-name }}-rocm
|
rocm.tags=${{ steps.setup.outputs.image-tags }}-rocm
|
||||||
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max
|
*.cache-to=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm,mode=max
|
||||||
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm
|
*.cache-from=type=registry,ref=${{ steps.setup.outputs.cache-name }}-rocm
|
||||||
arm64_extra_builds:
|
arm64_extra_builds:
|
||||||
@ -163,6 +165,7 @@ jobs:
|
|||||||
uses: ./.github/actions/setup
|
uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
tag-suffix: -rk
|
||||||
- name: Build and push Rockchip build
|
- name: Build and push Rockchip build
|
||||||
uses: docker/bake-action@v6
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
@ -171,7 +174,7 @@ jobs:
|
|||||||
targets: rk
|
targets: rk
|
||||||
files: docker/rockchip/rk.hcl
|
files: docker/rockchip/rk.hcl
|
||||||
set: |
|
set: |
|
||||||
rk.tags=${{ steps.setup.outputs.image-name }}-rk
|
rk.tags=${{ steps.setup.outputs.image-tags }}
|
||||||
*.cache-from=type=gha
|
*.cache-from=type=gha
|
||||||
# The majority of users running arm64 are rpi users, so the rpi
|
# The majority of users running arm64 are rpi users, so the rpi
|
||||||
# build should be the primary arm64 image
|
# build should be the primary arm64 image
|
||||||
@ -194,9 +197,15 @@ jobs:
|
|||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Create short sha
|
- name: Create short sha
|
||||||
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
|
||||||
|
- uses: docker/metadata-action@v5
|
||||||
|
id: metadata
|
||||||
|
with:
|
||||||
|
images: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}
|
||||||
|
tags: type=raw,value=${{ env.SHORT_SHA }}
|
||||||
- uses: int128/docker-manifest-create-action@v2
|
- uses: int128/docker-manifest-create-action@v2
|
||||||
with:
|
with:
|
||||||
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}
|
index-annotations: ${{ steps.metadata.outputs.labels }}
|
||||||
|
tags: ${{ steps.metadata.outputs.tags }}
|
||||||
sources: |
|
sources: |
|
||||||
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-amd64
|
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-amd64
|
||||||
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-rpi
|
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-rpi
|
||||||
|
Loading…
Reference in New Issue
Block a user