Skip to content

Commit

Permalink
Add image description annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienPatte committed Aug 25, 2024
1 parent a92dd78 commit b8ac350
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ DEFAULT_GOLANG_VERSION="1.21"
DEFAULT_CHISEL_VERSION="v0.10.0"

REPOSITORY=$(jq -r '.repository' ./images/${IMAGE}/metadata.json)
DESCRIPTION=$(curl -s "https://api.github.com/repos/${REPOSITORY}" | jq -r '.description | values')
RELEASE_METADATA=$(curl -s "https://api.github.com/repos/${REPOSITORY}/releases/latest")
SOURCE_DATE_EPOCH=$(date +%s -d $(echo ${RELEASE_METADATA} | jq -r '.created_at'))
RELEASE=$(echo ${RELEASE_METADATA} | jq -r '.tag_name')
Expand All @@ -35,7 +36,8 @@ else
--label "org.opencontainers.image.version=${VERSION}" \
--label "org.opencontainers.image.vendor=${GITHUB_REPOSITORY_OWNER}" \
--label "org.opencontainers.image.title=${IMAGE}" \
--output type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:${VERSION},rewrite-timestamp=true \
--output type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:latest,rewrite-timestamp=true \
--annotation "org.opencontainers.image.description=${DESCRIPTION}" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:${VERSION},rewrite-timestamp=true" \
--output "type=registry,name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE}:latest,rewrite-timestamp=true" \
- < images/${IMAGE}/Dockerfile
fi
1 change: 1 addition & 0 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- desc # TODO2

name: Build images

Expand Down

0 comments on commit b8ac350

Please sign in to comment.