Skip to content

Commit

Permalink
added step to clean tag list if it contains latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rob93c committed Oct 6, 2023
1 parent 7a09bc7 commit e995d12
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,24 @@ jobs:
rob93c/stickerify
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=pr
- name: Set Docker tags
id: docker-tags
run: |
cleaned_tags=${{ steps.metadata.outputs.tags }}
if [[ " ${{ cleaned_tags }} " =~ "latest" ]] then
cleaned_tags=("latest")
fi
echo "tags=${cleaned_tags}" >> "$GITHUB_OUTPUT"
- name: Upload Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.metadata.outputs.tags }}
tags: ${{ steps.docker-tags.outputs.cleaned_tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down

0 comments on commit e995d12

Please sign in to comment.