From 44188ebe9cc522dc2beebffacc4576f730a8fdfa Mon Sep 17 00:00:00 2001 From: scrungus <33693738+scrungus@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:33:01 +0100 Subject: [PATCH] fixed latest tagging fixed latest tagging --- .github/workflows/build-and-push-images.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-push-images.yml b/.github/workflows/build-and-push-images.yml index 3166282..cce1182 100644 --- a/.github/workflows/build-and-push-images.yml +++ b/.github/workflows/build-and-push-images.yml @@ -26,7 +26,8 @@ jobs: uses: actions/checkout@v3 - name: Log in to the Container registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 + if: github.event_name != 'pull_request' with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -34,13 +35,17 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false tags: | - # set latest tag for master branch - type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} - + # minimal + type=pep440,pattern={{version}} + # set latest tag for default branch + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push Docker image uses: docker/build-push-action@v4 with: