From aa98e86192e2651119f8d910a0e51bf2d9200f38 Mon Sep 17 00:00:00 2001 From: sd109 Date: Mon, 2 Sep 2024 11:24:10 +0100 Subject: [PATCH] Only tag images as latest on main branch --- .../workflows/docker-build-push-backend-container-on-tag.yml | 2 +- .github/workflows/docker-build-push-web-container-on-tag.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-build-push-backend-container-on-tag.yml b/.github/workflows/docker-build-push-backend-container-on-tag.yml index f88bc949f46..77a454c7dc7 100644 --- a/.github/workflows/docker-build-push-backend-container-on-tag.yml +++ b/.github/workflows/docker-build-push-backend-container-on-tag.yml @@ -35,7 +35,7 @@ jobs: push: true tags: | ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} - ${{ env.REGISTRY_IMAGE }}:latest + type=raw,value=${{ env.REGISTRY_IMAGE }}:latest,enable=${{ github.ref == 'refs/heads/main' }} build-args: | DANSWER_VERSION=${{ github.ref_name }} cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache diff --git a/.github/workflows/docker-build-push-web-container-on-tag.yml b/.github/workflows/docker-build-push-web-container-on-tag.yml index 13f59b7b8b4..e880afed19c 100644 --- a/.github/workflows/docker-build-push-web-container-on-tag.yml +++ b/.github/workflows/docker-build-push-web-container-on-tag.yml @@ -34,7 +34,7 @@ jobs: images: ${{ env.REGISTRY_IMAGE }} tags: | type=raw,value=${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }} - type=raw,value=${{ env.REGISTRY_IMAGE }}:latest + type=raw,value=${{ env.REGISTRY_IMAGE }}:latest,enable=${{ github.ref == 'refs/heads/main' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3