From e6379f443fde4552cb24b1a4f56075abc5107b65 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:16:02 +0100 Subject: [PATCH] Delete unused internal images by digest --- .github/workflows/build-test-publish.yml | 38 +++++++++++++++++------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-test-publish.yml b/.github/workflows/build-test-publish.yml index e174e971..a77cfea1 100644 --- a/.github/workflows/build-test-publish.yml +++ b/.github/workflows/build-test-publish.yml @@ -29,15 +29,33 @@ jobs: | jq --exit-status -r '.raw_id_token' ) echo "${REGISTRY_TOKEN}" | docker login '${{ secrets.REGISTRY_HOST }}' -u '${{ secrets.REGISTRY_USER }}' --password-stdin - - name: Fetch digests of unused internal images + - name: Delete unused internal images by digest run: | set -x - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18:builder' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18:build' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18:run' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20:builder' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20:build' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20:run' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22:builder' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22:build' - crane digest --full-ref '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22:run' + # heroku-18:builder + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18@sha256:32771207cd33a076a5898a83687473cf9353bf340e78ba875f12bb55592d2600 + + # heroku-18:build + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18@sha256:4d7adfa03d59cdab8f9b938cba9923b215bc3abaa049cf1da56df9f836ad98d6 + + # heroku-18:run + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-18@sha256:e33a0c2615bb37c01c0df6c2f10caa108bb752f69b5efe94b1d40a4e9d7384d0 + + # heroku-20:builder + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20@sha256:0194d86a97bfb3faa8fe3e512f1fdde3a0179e12d748c0b549238c264319a686 + + # heroku-20:build + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20@sha256:fbafc9cfcc09db03c60bdc26b2d9a70384d10c87e8065d931349fc9d6e40e254 + + # heroku-20:run + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-20@sha256:ad8a891f3714c3fc81f9b42461cb03ef35912639556b309129772f68a7b24068 + + # heroku-22:builder + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22@sha256:a7ccf5f4ea9794a7628f4f940bf2298123c969df5821f7ea1b72f643e3c08cd3 + + # heroku-22:build + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22@sha256:eeaba2cff9d7b3591a37fb72c15bfcfdbf7eee3e98b7f7f4a09adbb20040a89d + + # heroku-22:run + crane delete '${{ secrets.REGISTRY_HOST }}/s/${{ secrets.SERVICE_TOKEN_USER_NAME }}/heroku-22@sha256:b4bebb3f92aaf3ac88ede26b46291427a462490e890802e1c7bd087de439c48f +