Clean-up single package #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete old packages | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
package: | |
description: "Package name" | |
required: true | |
type: choice | |
options: | |
# - test-cloud-server | |
# - cert-tool | |
# - grpc-gateway | |
# - coap-gateway | |
# - resource-directory | |
# - identity-store | |
# - http-gateway | |
# - resource-aggregate | |
# - bundle | |
- mock-oauth-server | |
- cloud2cloud-connector | |
- cloud2cloud-gateway | |
# - certificate-authority | |
- coap-gateway-go1-18 | |
- nats-server-config-reloader | |
jobs: | |
ghcr-cleanup-old-packages: | |
name: Delete old tagged images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete older than a month vnext images | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: hub/mock-oauth-server | |
cut-off: One month ago UTC | |
account-type: org | |
org-name: plgd-dev | |
filter-tags: vnext-* | |
skip-tags: vnext-pr*,main | |
token: ${{ secrets.GHCR_CLEANUP_PAT }} | |
- name: Delete older than a month vnext-pr images | |
uses: snok/container-retention-policy@v2 | |
with: | |
image-names: hub/mock-oauth-server | |
cut-off: One week ago UTC | |
account-type: org | |
org-name: plgd-dev | |
filter-tags: vnext-pr* | |
skip-tags: main | |
token: ${{ secrets.GHCR_CLEANUP_PAT }} | |
ghcr-cleanup-untagged-packages: | |
name: Delete untagged packages | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: ghcr-cleanup-old-packages | |
steps: | |
- name: Set up Docker Buildx for delete untagged images action | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry for delete untagged images action | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_CLEANUP_PAT }} | |
- name: Delete untagged images with no dependency | |
uses: Chizkiyahu/delete-untagged-ghcr-action@v3 | |
with: | |
package_name: hub/mock-oauth-server | |
repository: ${{ github.repository }} | |
repository_owner: ${{ github.repository_owner }} | |
token: ${{ secrets.GHCR_CLEANUP_PAT }} | |
owner_type: org | |
untagged_only: true | |
except_untagged_multiplatform: true |