From 0290e31278d93b3093838166045d7ce8b1a89b55 Mon Sep 17 00:00:00 2001 From: Thilo Schwarz Date: Sun, 12 Jul 2026 12:31:18 +0200 Subject: [PATCH] Update `deploy-image.yml` to handle tag-based deployments and dynamically compute image tags --- .gitea/workflows/deploy-image.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy-image.yml b/.gitea/workflows/deploy-image.yml index f40d084..1bfe366 100644 --- a/.gitea/workflows/deploy-image.yml +++ b/.gitea/workflows/deploy-image.yml @@ -2,6 +2,8 @@ name: Build and Push Docker Image on: push: + tags: + - 'v*' workflow_dispatch: jobs: @@ -16,7 +18,6 @@ jobs: uses: actions/checkout@v4 - name: Compute image name and tag - id: meta run: | REGISTRY=$(echo "${{ github.server_url }}" | sed 's|https\?://||') OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]') @@ -25,8 +26,8 @@ jobs: FULL_IMAGE="${REGISTRY}/${OWNER}/${IMAGE_NAME}" REF="${{ github.ref_name }}" - if [ "${REF}" = "main" ]; then - TAG="latest" + if [[ "${REF}" == v* ]]; then + TAG="${REF#v}" else TAG=$(echo "${REF}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]/-/g') fi @@ -62,4 +63,4 @@ jobs: with: context: . push: true - tags: git.mein-gateway.de/thischwa/javadocviewerservice:develop \ No newline at end of file + tags: ${{ steps.metai.outputs.image }}:${{ steps.metai.outputs.tag }} \ No newline at end of file