Skip to content

Commit 44188eb

Browse files
authored
fixed latest tagging
fixed latest tagging
1 parent 8227d97 commit 44188eb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/build-and-push-images.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,26 @@ jobs:
2626
uses: actions/checkout@v3
2727

2828
- name: Log in to the Container registry
29-
uses: docker/login-action@v2
29+
uses: docker/login-action@v3
30+
if: github.event_name != 'pull_request'
3031
with:
3132
registry: ${{ env.REGISTRY }}
3233
username: ${{ github.actor }}
3334
password: ${{ secrets.GITHUB_TOKEN }}
3435

3536
- name: Extract metadata (tags, labels) for Docker
3637
id: meta
37-
uses: docker/metadata-action@v4
38+
uses: docker/metadata-action@v5
3839
with:
3940
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
flavor: |
42+
latest=false
4043
tags: |
41-
# set latest tag for master branch
42-
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
43-
44+
# minimal
45+
type=pep440,pattern={{version}}
46+
# set latest tag for default branch
47+
type=raw,value=latest,enable={{is_default_branch}}
48+
4449
- name: Build and push Docker image
4550
uses: docker/build-push-action@v4
4651
with:

0 commit comments

Comments
 (0)