From ad1994014a431ea2d023b03927485609cce569e3 Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Wed, 13 Dec 2023 15:00:32 -0700 Subject: [PATCH] ci: container prunning --- .github/workflows/container-prune.yaml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/container-prune.yaml diff --git a/.github/workflows/container-prune.yaml b/.github/workflows/container-prune.yaml new file mode 100644 index 0000000000..a9e244d7fc --- /dev/null +++ b/.github/workflows/container-prune.yaml @@ -0,0 +1,28 @@ +name: Container Image Cleanup + +on: + push: + branches-ignore: [ main ] + + +jobs: + prune: + name: Prune Container Images + runs-on: ubuntu-latest + steps: + - name: Retrieve Credentials + id: import-secrets + uses: hashicorp/vault-action@v2.7.3 + with: + url: https://vault.prism.spectrocloud.com + method: approle + roleId: ${{ secrets.VAULT_ROLE_ID }} + secretId: ${{ secrets.VAULT_SECRET_ID }} + secrets: /providers/github/organizations/spectrocloud/token?org_name=spectrocloud token | VAULT_GITHUB_TOKEN + + - uses: bots-house/ghcr-delete-image-action@v1.1.0 + with: + owner: spectrocloud + name: librarium + token: ${{ steps.import-secrets.outputs.VAULT_GITHUB_TOKEN }} + untagged-keep-latest: 2