Add docker metadata - fixes #19618

This commit is contained in:
Gavin Mogan 2025-09-04 21:42:16 -07:00
parent b781f06f9c
commit 962cde3446
2 changed files with 20 additions and 4 deletions

View File

@ -5,7 +5,9 @@ inputs:
required: true
outputs:
image-name:
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:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
runs:
@ -48,3 +50,10 @@ runs:
- id: create-short-sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
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 }}

View File

@ -39,6 +39,7 @@ jobs:
push: true
platforms: linux/amd64
target: frigate
labels: ${{ steps.setup.outputs.image-labels }}
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
@ -63,8 +64,8 @@ jobs:
push: true
platforms: linux/arm64
target: frigate
tags: |
${{ steps.setup.outputs.image-name }}-standard-arm64
labels: ${{ steps.setup.outputs.image-labels }}
tags: ${{ steps.setup.outputs.image-name }}-standard-arm64
cache-from: type=registry,ref=${{ steps.setup.outputs.cache-name }}-arm64
- name: Build and push RPi build
uses: docker/bake-action@v6
@ -194,9 +195,15 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create short sha
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
with:
tags: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}
index-annotations: ${{ steps.metadata.outputs.labels }}
tags: ${{ steps.metadata.outputs.tags }}
sources: |
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-amd64
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}-rpi