Skip to content

Commit

Permalink
ci (refactor): use json metadata for description
Browse files Browse the repository at this point in the history
Gets description from repo instead of dockerfile
  • Loading branch information
pythoninthegrass committed Oct 10, 2024
1 parent 4b621a0 commit 8103b97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ jobs:
flavor: |
latest=false
- name: Extract description from Dockerfile
id: dockerfile_description
run: |
DESCRIPTION=$(grep "LABEL org.opencontainers.image.description" ${{ matrix.dockerfile }} | cut -d'"' -f2 || echo "")
if [ -z "$DESCRIPTION" ]; then
DESCRIPTION="No description provided"
echo "Warning: No description found in Dockerfile. Using default." >&2
fi
echo "DESCRIPTION=$DESCRIPTION" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -103,6 +93,6 @@ jobs:
platforms: linux/amd64,linux/arm64/v8
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}
cache-to: type=registry,ref=${{ steps.meta.outputs.tags }},mode=max
outputs: |
type=image,name=${{ steps.meta.outputs.tags }},annotation-index.org.opencontainers.image.description=${{ steps.dockerfile_description.outputs.DESCRIPTION }}
outputs: >
type=image,name=${{ steps.meta.outputs.tags }},
annotation-index.org.opencontainers.image.description=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.description'] }}
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ ENV APP_ENV=docker
ENTRYPOINT ["/bin/sh", "docker-entrypoint.sh"]

LABEL org.opencontainers.image.title="musicbot"
LABEL org.opencontainers.image.description "The original MusicBot for Discord"

0 comments on commit 8103b97

Please sign in to comment.