From 415fab7f83ff71db6408afbf111d9a001203a0c6 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Thu, 22 Feb 2024 05:58:50 -0900 Subject: [PATCH] Cleanup untagged images on the GitHub Container Registry (#191) --- .github/workflows/alpine-mainline.yml | 11 ++++++++++- .github/workflows/alpine-stable.yml | 11 ++++++++++- .github/workflows/debian-mainline.yml | 11 ++++++++++- .github/workflows/debian-stable.yml | 11 ++++++++++- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/alpine-mainline.yml b/.github/workflows/alpine-mainline.yml index ca5ed32..4cb82f3 100644 --- a/.github/workflows/alpine-mainline.yml +++ b/.github/workflows/alpine-mainline.yml @@ -376,7 +376,7 @@ jobs: NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} cleanup: - name: Delete untagged Alpine NGINX mainline Docker images on the Amazon ECR Public Gallery + name: Delete untagged Alpine NGINX mainline Docker images on the Amazon ECR Public Gallery and the GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-22.04 strategy: @@ -396,3 +396,12 @@ jobs: - name: Delete untagged Alpine NGINX mainline Docker images on the Amazon ECR Public Gallery run: | .github/workflows/scripts/delete-untagged-amazon-public-ecr-images.sh + + - name: Delete untagged Alpine NGINX mainline Docker images on the GitHub Container Registry + uses: stumpylog/image-cleaner-action/untagged@9255a1b3b8ca44b3e5887e2168155223b277ca1d # v0.5.0 + with: + is_org: true + owner: nginxinc + package_name: nginx-unprivileged + do_delete: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/alpine-stable.yml b/.github/workflows/alpine-stable.yml index 1be0651..b0ebfc3 100644 --- a/.github/workflows/alpine-stable.yml +++ b/.github/workflows/alpine-stable.yml @@ -352,7 +352,7 @@ jobs: NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} cleanup: - name: Delete untagged Alpine NGINX stable Docker images on the Amazon ECR Public Gallery + name: Delete untagged Alpine NGINX stable Docker images on the Amazon ECR Public Gallery and the GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-22.04 strategy: @@ -372,3 +372,12 @@ jobs: - name: Delete untagged Alpine NGINX stable Docker images on the Amazon ECR Public Gallery run: | .github/workflows/scripts/delete-untagged-amazon-public-ecr-images.sh + + - name: Delete untagged Alpine NGINX stable Docker images on the GitHub Container Registry + uses: stumpylog/image-cleaner-action/untagged@9255a1b3b8ca44b3e5887e2168155223b277ca1d # v0.5.0 + with: + is_org: true + owner: nginxinc + package_name: nginx-unprivileged + do_delete: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/debian-mainline.yml b/.github/workflows/debian-mainline.yml index fa57111..f0b62e0 100644 --- a/.github/workflows/debian-mainline.yml +++ b/.github/workflows/debian-mainline.yml @@ -261,7 +261,7 @@ jobs: NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} cleanup: - name: Delete untagged Debian NGINX mainline Docker images on the Amazon ECR Public Gallery + name: Delete untagged Debian NGINX mainline Docker images on the Amazon ECR Public Gallery and the GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-22.04 strategy: @@ -281,3 +281,12 @@ jobs: - name: Delete untagged Debian NGINX mainline Docker images on the Amazon ECR Public Gallery run: | .github/workflows/scripts/delete-untagged-amazon-public-ecr-images.sh + + - name: Delete untagged Debian NGINX mainline Docker images on the GitHub Container Registry + uses: stumpylog/image-cleaner-action/untagged@9255a1b3b8ca44b3e5887e2168155223b277ca1d # v0.5.0 + with: + is_org: true + owner: nginxinc + package_name: nginx-unprivileged + do_delete: true + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/debian-stable.yml b/.github/workflows/debian-stable.yml index 76567db..e3dc616 100644 --- a/.github/workflows/debian-stable.yml +++ b/.github/workflows/debian-stable.yml @@ -245,7 +245,7 @@ jobs: NOTARY_TARGETS_PASSPHRASE: ${{ secrets.DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE }} cleanup: - name: Delete untagged Debian NGINX stable Docker images on the Amazon ECR Public Gallery + name: Delete untagged Debian NGINX stable Docker images on the Amazon ECR Public Gallery and the GitHub Container Registry if: ${{ github.event_name != 'pull_request' }} runs-on: ubuntu-22.04 strategy: @@ -265,3 +265,12 @@ jobs: - name: Delete untagged Debian NGINX stable Docker images on the Amazon ECR Public Gallery run: | .github/workflows/scripts/delete-untagged-amazon-public-ecr-images.sh + + - name: Delete untagged Debian NGINX stable Docker images on the GitHub Container Registry + uses: stumpylog/image-cleaner-action/untagged@9255a1b3b8ca44b3e5887e2168155223b277ca1d # v0.5.0 + with: + is_org: true + owner: nginxinc + package_name: nginx-unprivileged + do_delete: true + token: ${{ secrets.GITHUB_TOKEN }}