From 680110d2f5623ebcf1ca55274055ad9d17e245e7 Mon Sep 17 00:00:00 2001 From: alexanderM91 Date: Thu, 17 Oct 2024 12:34:06 +0200 Subject: [PATCH] Automatic (outdated) images cleanup --- .github/workflows/cleanup-old-docker-images.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cleanup-old-docker-images.yml b/.github/workflows/cleanup-old-docker-images.yml index 3349aff0..24b6f114 100644 --- a/.github/workflows/cleanup-old-docker-images.yml +++ b/.github/workflows/cleanup-old-docker-images.yml @@ -46,6 +46,11 @@ jobs: if [[ ${AGE} -ge ${THRESHOLD} ]] && [[ ${TAG_NAME} =~ ${HASH_PATTERN} ]]; then echo "Deleting image tag ${TAG_NAME} (last updated: ${LAST_UPDATED})" IMAGES_DELETED=true + + curl -X DELETE \ + -u "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" \ + "https://hub.docker.com/v2/repositories/${REPO}/tags/${TAG_NAME}/" + fi done