From 413583527034acbedae685d4dcff145b6bd91ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Achim=20Kr=C3=A4mer?= <39946364+pxlfrk@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:42:12 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20add=20OCI=20docker?= =?UTF-8?q?=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Achim Krämer <39946364+pxlfrk@users.noreply.github.com> --- .github/workflows/cd.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0660bcba..e1a32cce 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 }} From 2170f876745849f237de1c09d0f65e8c43b3fd21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Achim=20Kr=C3=A4mer?= <39946364+pxlfrk@users.noreply.github.com> Date: Wed, 14 Feb 2024 18:52:46 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20improve=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Achim Krämer <39946364+pxlfrk@users.noreply.github.com> --- .github/workflows/cd.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e1a32cce..0cd82a07 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -4,7 +4,18 @@ 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" + 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: