Skip to content

Commit

Permalink
Trying to fix old image cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
craigk5n committed Sep 29, 2023
1 parent 15aba16 commit 2f61e94
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_REPO: ${{ secrets.DOCKER_HUB_USERNAME }}/webcalendar
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} # Updated line
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
Expand All @@ -67,9 +68,7 @@ jobs:
if [ $COUNTER -ge $KEEP_LAST_N_IMAGES ]
then
echo "Deleting tag $TAG"
AUTH_HEADER="Authorization: Basic $(echo -n $DOCKER_HUB_USERNAME:$DOCKER_HUB_ACCESS_TOKEN | base64)"
curl -i -X DELETE -u -H "$AUTH_HEADER" https://hub.docker.com/v2/repositories/$DOCKER_HUB_REPO/tags/$TAG/
#curl -X DELETE -u $DOCKER_HUB_USERNAME:$DOCKER_HUB_ACCESS_TOKEN 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 2f61e94

Please sign in to comment.