aurora/.github/workflows/clean.yml
renner 6af2b2781c
feat(ci): package cache with OCI artifacts (#2466)
* feat(ci): package cache with OCI artifacts

We are hitting a couple limitations in regards to actions/cache [1] with
our new testing branch workflow, as we previously relied on scheduled
builds from the main branch, which we no longer do with this model.

Now we make new cache on merge_group on the first build on Sundays, I
chose Sundays just because. Which means we run only a single build with
no cache per week and use that same build to generate a new fresh cache.

Else we would end up with 3 versions of vscode in our cache.
There is no point uploading cache on *every* PR.

For simplicity sake this has no handling/differentiation for our stable
and main branch. When we bump the fedora version of our main/testing
images then the cache for stable will just get stale.

We are mixing root/rootless usage of oras/cosign, I made it use root or
else we will get premission issues.

[1]: https://github.com/actions/cache/issues/1537

fixes: https://github.com/ublue-os/aurora/issues/2351

* define blessed day

* chore: remove command -v prefixes

not needed, running everything rootless now
2026-07-04 21:00:59 +00:00

34 lines
1,010 B
YAML

name: Cleanup Old Images
on:
schedule:
- cron: "15 0 * * 0" # 0015 UTC on Sundays
workflow_dispatch:
permissions: {}
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/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
packages: aurora,aurora-dx,aurora-nvidia-open,aurora-dx-nvidia-open
older-than: 90 days
delete-orphaned-images: true
keep-n-tagged: 7
keep-n-untagged: 7
- name: Delete All OCI Artifact Cache
uses: dataaxiom/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
packages: aurora/cache/dnf
keep-n-tagged: 1
older-than: 90 days