Skip to content

Commit 7b9261e

Browse files
committed
docker: add cleanup step for old GitHub Packages images
This change introduces a step to clean up old untagged container images in GitHub Packages, ensuring better management of package versions during the build process. Signed-off-by: Chiho Sin <[email protected]>
1 parent 0df4ed8 commit 7b9261e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/docker_build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,12 @@ jobs:
8484
tags: ${{ steps.meta.outputs.tags }}
8585
labels: ${{ steps.meta.outputs.labels }}
8686
platforms: ${{ inputs.platform }}
87-
target: ${{ inputs.port }}
87+
target: ${{ inputs.port }}
88+
89+
- name: Cleanup GitHub Packages images
90+
if: ${{ inputs.push }}
91+
uses: actions/delete-package-versions@v4
92+
with:
93+
package-name: ${{ github.repository }}
94+
package-type: container
95+
delete-only-untagged-versions: true

0 commit comments

Comments
 (0)