-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update container image cleanup GitHub actions
Switch to dataaxiom/ghcr-cleanup-action which treats multi-arch images correctly and refactor the cleanup jobs so that we delete untagged versions once a day from Monday to Friday and delete PR tags once the PR is closed (merged or unmerged).
- Loading branch information
Showing
2 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
.github/workflows/gitlab-container-image-cleanup-pr-tag.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
name: Delete closed PR container image tag | ||
|
||
"on": | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
cleanup-pr-tag: | ||
uses: ubuntu-latest | ||
steps: | ||
- name: Set image version for PR to branch name | ||
run: echo "VERSION=${GITHUB_HEAD_REF//\//-}" >> ${GITHUB_ENV} | ||
|
||
- name: Delete PR container image tag | ||
uses: dataaxiom/ghcr-cleanup-action@v1 | ||
with: | ||
tags: ${{ env.VERSION }} | ||
package: ${{ github.event.repository.name }}/gitlab | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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