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: