Skip to content

Commit

Permalink
Restric publishing the "latest" tag to GA releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Dec 30, 2024
1 parent 9555d69 commit dafa3bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ jobs:
TAGS="$TAGS,${{ env.ECR_REGISTRY }}${{ github.repository }}:latest-${BASE_OS}"
LATEST_TAGS="$TAGS,${{ github.repository }}:latest"
LATEST_TAGS="$LATEST_TAGS,${{ env.ECR_REGISTRY }}${{ github.repository }}:latest"
echo is_production=true >> $GITHUB_OUTPUT
else
LATEST_TAGS="$TAGS"
echo is_production=false >> $GITHUB_OUTPUT
fi
printf "Tagging %s with " "${BASE_OS}"
if [[ "${BASE_OS}" == "$LATEST_TAG_OS" ]]; then
Expand Down Expand Up @@ -124,8 +126,8 @@ jobs:
type=semver,pattern={{version}}
type=ref,event=pr,prefix=pr-,suffix=-${{matrix.os}}
type=sha,prefix=sha-,suffix=-${{matrix.os}}
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' }}
type=raw,value=latest,suffix=,enable=${{ github.event_name == 'release' && github.event.action == 'published' && matrix.os == env.LATEST_TAG_OS }}
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false && steps.prepare.outputs.is_production == 'yes' }}
type=raw,value=latest,suffix=,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false && steps.prepare.outputs.is_production == 'yes' && matrix.os == env.LATEST_TAG_OS }}
- name: Show metadata
run: |
Expand Down

0 comments on commit dafa3bc

Please sign in to comment.