2021-10-11 12:08:34 +00:00
|
|
|
name: ghcr-retention
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-04-21 10:54:23 +00:00
|
|
|
- cron: "0 0 * * *" # every day at midnight
|
2021-10-20 09:18:23 +00:00
|
|
|
workflow_dispatch:
|
2021-10-11 12:08:34 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
clean-ghcr:
|
|
|
|
name: Delete old unused container images
|
2023-08-31 09:48:37 +00:00
|
|
|
runs-on: large-4core-ubuntu-22.04
|
2021-10-11 12:08:34 +00:00
|
|
|
steps:
|
2023-05-31 12:23:04 +00:00
|
|
|
- id: generate_token
|
|
|
|
uses: tibdex/github-app-token@v1
|
|
|
|
with:
|
|
|
|
app_id: ${{ secrets.GH_APP_ID }}
|
|
|
|
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
2021-10-11 12:08:34 +00:00
|
|
|
- name: Delete 'dev' containers older than a week
|
2023-02-17 08:44:04 +00:00
|
|
|
uses: snok/container-retention-policy@v2
|
2021-10-11 12:08:34 +00:00
|
|
|
with:
|
|
|
|
image-names: dev-server,dev-ldap,dev-proxy
|
2021-10-20 09:17:57 +00:00
|
|
|
cut-off: One week ago UTC
|
2021-10-11 12:08:34 +00:00
|
|
|
account-type: org
|
|
|
|
org-name: goauthentik
|
|
|
|
untagged-only: false
|
2023-05-31 12:23:04 +00:00
|
|
|
token: ${{ steps.generate_token.outputs.token }}
|
2022-06-03 17:40:09 +00:00
|
|
|
skip-tags: gh-next,gh-main
|