Skip to content

Commit

Permalink
added bash commands to retrieve docker tags and delete unneeded ones
Browse files Browse the repository at this point in the history
  • Loading branch information
rob93c committed Oct 6, 2023
1 parent faaf54d commit 279116d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Delete Docker tags
if: github.ref == 'refs/heads/main'
run: |
tags_to_keep=("latest" "native")
tags=$(curl -s "https://hub.docker.com/v2/repositories/rob93c/stickerify/tags/" | jq -r '.results[].name')
for tag in $tags; do
if [[ ! " ${tags_to_keep[@]} " =~ " ${tag} " ]]; then
docker rmi rob93c/stickerify:$tag
fi
done

0 comments on commit 279116d

Please sign in to comment.