From fc62766471ee7d590d56a3bbfef0eaf877066b72 Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Fri, 27 Feb 2026 18:00:58 +0100 Subject: [PATCH] Fix Docker metadata tags to prevent registry name duplication --- .github/workflows/ci-cd.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 788fb57..b25aa51 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -124,10 +124,21 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata - id: meta + id: meta-backend uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/backend + tags: | + type=ref,event=branch + type=ref,event=pr + type=sha,prefix={{branch}}- + type=raw,value=latest,enable={{is_default_branch}} + + - name: Extract metadata + id: meta-frontend + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend tags: | type=ref,event=branch type=ref,event=pr @@ -139,16 +150,16 @@ jobs: with: context: ./backend push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/backend:${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-backend.outputs.tags }} + labels: ${{ steps.meta-backend.outputs.labels }} - name: Build and push frontend image uses: docker/build-push-action@v4 with: context: ./frontend push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/frontend:${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-frontend.outputs.tags }} + labels: ${{ steps.meta-frontend.outputs.labels }} deploy: name: Deploy to Production