🏷️ add OCI docker labels

Signed-off-by: Achim Krämer <39946364+pxlfrk@users.noreply.github.com>
This commit is contained in:
Achim Krämer 2024-02-14 18:42:12 +01:00
parent 784237bfab
commit 4135835270
No known key found for this signature in database
GPG Key ID: 826E7661FDB486AB

View File

@ -2,6 +2,10 @@ name: Create docker images
on: [create]
env:
# set Docker OCI Labels
DOCKER_LABELS: org.opencontainers.image.title=${{github.event.repository.name}}, org.opencontainers.image.description="Umami is a simple, fast, privacy-focused alternative to Google Analytics", org.opencontainers.image.vendor=${{github.repository_owner}}, org.opencontainers.image.licenses="MIT", org.opencontainers.image.version=${{github.ref_name}}, org.opencontainers.image.created=${{ env.NOW }}, org.opencontainers.image.source=${{github.server_url}}/${{github.repository}}, org.opencontainers.image.revision=${{github.sha}}, org.opencontainers.image.url="https://umami.is/", org.opencontainers.image.documentation="https://umami.is/docs", org.opencontainers.image.base.name="docker.io/library/node:18-alpine"
jobs:
build:
name: Build, push, and deploy
@ -16,13 +20,16 @@ jobs:
- uses: actions/checkout@v3
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NOW=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }}
with:
image: umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
labels: $DOCKER_LABELS
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: ghcr.io
multiPlatform: true
@ -30,11 +37,13 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to docker.io for ${{ matrix.db-type }}
with:
image: umamisoftware/umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
labels: $DOCKER_LABELS
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}