Skip to content

Commit

Permalink
Remove untagged private images (#7)
Browse files Browse the repository at this point in the history
Every night, we create a new "latest" image. This ends up leaving a
lot of junk behind in the GitHub package UI for our private image
that is hosted in the GitHub container registry. There's hundreds
of older, never to be used, former "most recent nightly" images.
Each is untagged and won't ever be used again (if it was ever used).

This commit adds a steps in the nightly creation workflow to delete
all untagged 'library-documentation-action-v2' images except the
most recent. We leave one as it is possible that something might
reasonably be in the process of pulling down "latest" while we are
doing the deletion and don't want to whack any layers that might
be needed for that.

This change removes a ton of noise of the GitHub packages UI for
'library-documentation-action-v2' and also stops wasting storage
space on GitHub for what we consider to be "junk images".
  • Loading branch information
SeanTAllen authored Aug 22, 2023
1 parent 5b3d3f2 commit e045448
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/update-latest-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,30 @@ jobs:
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.

prune-untagged-images:
needs:
- rebuild-private-latest-image

name: Prune untagged images
runs-on: ubuntu-latest
steps:
- name: Prune
# v4.1.1
uses: actions/delete-package-versions@0d39a63126868f5eefaa47169615edd3c0f61e20
with:
package-name: 'library-documentation-action-v2'
package-type: 'container'
min-versions-to-keep: 1
delete-only-untagged-versions: 'true'
- name: Send alert on failure
if: ${{ failure() }}
uses: zulip/github-actions-zulip/send-message@b62d5a0e48a4d984ea4fce5dd65ba691963d4db4
with:
api-key: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_API_KEY }}
email: ${{ secrets.ZULIP_SCHEDULED_JOB_FAILURE_EMAIL }}
organization-url: 'https://ponylang.zulipchat.com/'
to: notifications
type: stream
topic: ${{ github.repository }} scheduled job failure
content: ${{ github.server_url}}/${{ github.repository }}/actions/runs/${{ github.run_id }} failed.

0 comments on commit e045448

Please sign in to comment.