From 593c0b686c6a95640f925ef75e56ea395637cf8a Mon Sep 17 00:00:00 2001 From: Alessio Dal Santo Date: Mon, 2 Feb 2026 12:08:52 +0100 Subject: [PATCH] fix: Tag latest solo per branch main - Rimosso tag 'latest' da branch development, staging e dev - Tag 'latest' ora riservato esclusivamente al branch main - Altri branch mantengono tag specifici (development-latest, staging-latest, dev-latest) - Modificati workflow GitHub Actions e Gitea Actions - Semplifica la gestione delle versioni in produzione vs sviluppo --- .gitea/workflows/docker-build.yml | 10 ++++------ .github/workflows/docker-build.yml | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 47f0c36..60c6976 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -105,15 +105,16 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - # Tag based on branch + # Tag based on branch - latest only for main type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=raw,value=latest-linux,enable=${{ github.ref == 'refs/heads/main' }} - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/development' }} - type=raw,value=latest-linux,enable=${{ github.ref == 'refs/heads/development' }} + # Development branch - no latest tag type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }} type=raw,value=development-latest-linux,enable=${{ github.ref == 'refs/heads/development' }} + # Dev branch type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }} type=raw,value=dev-latest-linux,enable=${{ github.ref == 'refs/heads/dev' }} + # Staging branch type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }} type=raw,value=staging-latest-linux,enable=${{ github.ref == 'refs/heads/staging' }} # Tag with commit sha @@ -312,9 +313,6 @@ jobs: if: github.ref == 'refs/heads/development' run: | IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]') - docker buildx imagetools create -t ${IMAGE_LOWER}:latest \ - ${IMAGE_LOWER}:latest-linux \ - ${IMAGE_LOWER}:latest-windows docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \ ${IMAGE_LOWER}:development-latest-linux \ ${IMAGE_LOWER}:development-latest-windows diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 0fbbbe6..d6c2cd9 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -48,11 +48,13 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - # Tag based on branch + # Tag based on branch - latest only for main type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/development' }} + # Development branch - no latest tag type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }} + # Dev branch type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }} + # Staging branch type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }} # Tag with commit sha type=sha,prefix={{branch}}-,format=short @@ -173,9 +175,6 @@ jobs: if: github.ref == 'refs/heads/development' run: | IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]') - docker buildx imagetools create -t ${IMAGE_LOWER}:latest \ - ${IMAGE_LOWER}:latest \ - ${IMAGE_LOWER}:latest-windows docker buildx imagetools create -t ${IMAGE_LOWER}:development-latest \ ${IMAGE_LOWER}:development-latest \ ${IMAGE_LOWER}:development-latest-windows