Skip to content

Commit

Permalink
Merge branch 'craigk5n:master' into xact
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannon authored Sep 29, 2023
2 parents 9000f57 + 2f61e94 commit 3b7c041
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ jobs:
- name: Cleanup Old Images
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
DOCKER_HUB_REPO: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
KEEP_LAST_N_IMAGES: 5
run: |
# Get list of tags
RESPONSE=$(curl -s -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_PASSWORD -o /tmp/response.json -w "%{http_code}" https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/?page_size=100)
RESPONSE=$(curl -s -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_ACCESS_TOKEN -o /tmp/response.json -w "%{http_code}" https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/?page_size=100)
# Check HTTP Status Code
if [ "$RESPONSE" -ne 200 ]; then
Expand All @@ -67,7 +68,7 @@ jobs:
if [ $COUNTER -ge $KEEP_LAST_N_IMAGES ]
then
echo "Deleting tag $TAG"
curl -X DELETE -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_PASSWORD https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/$TAG/
curl -i -X DELETE -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_PASSWORD https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/$TAG/
else
echo "Keeping tag $TAG"
fi
Expand Down

0 comments on commit 3b7c041

Please sign in to comment.