From 946a2cad81000384370386e32c2690d8f82b4388 Mon Sep 17 00:00:00 2001 From: Zifei Tong Date: Sat, 24 Aug 2024 00:12:59 -0700 Subject: [PATCH] Delete old packages before building new ones See https://github.com/actions/delete-package-versions/issues/162 --- .github/workflows/build-and-push-image.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index 7d597c6..4e4e907 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -25,6 +25,13 @@ jobs: id-token: write steps: + - name: Delete old packages + uses: actions/delete-package-versions@v5 + with: + package-name: ${{ matrix.image }} + package-type: "container" + min-versions-to-keep: 16 + - name: Checkout repository uses: actions/checkout@v4.1.6 @@ -62,10 +69,3 @@ jobs: subject-name: ${{ env.REGISTRY }}/${{ env.USER_NAME }}/${{ matrix.image }} subject-digest: ${{ steps.push.outputs.digest }} push-to-registry: true - - - name: Delete old packages - uses: actions/delete-package-versions@v5 - with: - package-name: ${{ matrix.image }} - package-type: 'container' - min-versions-to-keep: 3