From 428793e3e3248635d4ecb471e938ccdd6ae69216 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 5 Jul 2023 13:08:18 +0100 Subject: [PATCH] feat: cleanup old GitHub packages This commit refactors the code to include a new step called "package-cleanup" in the docker-publish workflow. The step is responsible for deleting old package versions of the "linuxgsm" container, keeping only one version and deleting untagged versions. This change improves the efficiency and organization of our GitHub packages. --- .github/workflows/docker-publish.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d885ef6..9a5cb1c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -134,3 +134,16 @@ jobs: tags: | gameservermanagers/linuxgsm:ubuntu-18.04 ghcr.io/gameservermanagers/linuxgsm:ubuntu-18.04 + + package-cleanup: + name: Cleanup Old GitHub Packages + needs: [ build-ubuntu-1804, build-ubuntu-2004, build-ubuntu-2204 ] + runs-on: ubuntu-latest + steps: + - name: Delete Package Versions + uses: actions/delete-package-versions@v4 + with: + package-name: linuxgsm + package-type: container + min-versions-to-keep: 1 + delete-only-untagged-versions: true