From bfbebbcd5132e38cb794cd4b681489e2a28cb04e Mon Sep 17 00:00:00 2001 From: Antti Date: Fri, 9 Sep 2022 17:40:27 +0300 Subject: [PATCH] Improve Docker image tags (#337) --- .github/workflows/gradle.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 06fef547..1d9ddad3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -62,10 +62,13 @@ jobs: uses: docker/metadata-action@v4 with: images: ghcr.io/${{ github.repository }} + # Always tagged as the pushed branch (ex. master) + # For releases: latest, full version and major version (ex. latest, v3.3 and v3) tags: | - type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }} type=raw,value={{branch}} + type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} type=raw,value={{tag}},enable=${{ startsWith(github.ref, 'refs/tags/') }} + type=match,pattern=v\d+,group=0,enable=${{ startsWith(github.ref, 'refs/tags/') }} flavor: | latest=false - name: Build and push