Skip to content

Commit

Permalink
chore(ci): add a workflow to enforce removal of old images (#32)
Browse files Browse the repository at this point in the history
* chore(ci): add a workflow to enforce removal of old images

GitHub policy is they will remove our packages older than 90 days, but
they don't actually.

This workflow will self-enforce that to provide confidence that we won't
rely on things which may start disappearing sometime.

* chore: does not need to be a dry run
  • Loading branch information
bsherman authored Oct 29, 2024
1 parent 73a2e2f commit 9e51ba0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/cleanup-old-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cleanup Old Images
on:
schedule:
- cron: "15 0 * * *" # 0015 UTC everyday
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}

jobs:
delete-older-than-90:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Delete Images Older Than 90 Days
uses: dataaxiom/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
packages: asus-kernel,bazzite-kernel,coreos-stable-kernel,coreos-testing-kernel,fsync-ba-kernel,fsync-kernel,main-kernel,surface-kernel
older-than: 90 days
delete-orphaned-images: true
keep-n-tagged: 7
keep-n-untagged: 7
2 changes: 2 additions & 0 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
pull_request:
branches:
- main
paths-ignore:
- '.github/workflows/cleanup*.yml'

env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
Expand Down

0 comments on commit 9e51ba0

Please sign in to comment.