Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete branch tag on merge #92

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
rob93c/christmas-greeter
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
type=ref,event=branch,enable=${{ github.ref != 'refs/heads/master' }}
type=ref,event=pr

- name: Upload Docker image
Expand All @@ -43,3 +43,10 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Delete Docker tag
if: github.event.pull_request.merged
run: |
tag_to_delete="pr-${{github.event.issue.number}}"
docker rmi rob93c/christmas-greeter:$tag_to_delete
echo "The tag $tag_to_delete has been deleted"