cleanup.yml 964 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. name: Cleanup
  3. # yamllint disable-line rule:truthy
  4. on:
  5. workflow_dispatch:
  6. schedule:
  7. - cron: "4 4 * * *"
  8. concurrency:
  9. group: ${{ github.workflow }}
  10. cancel-in-progress: false
  11. permissions:
  12. contents: read
  13. jobs:
  14. registry:
  15. # FIXME: On forks it fails with "Failed to fetch packages: missing field `id` at line 1 column 141"
  16. if: github.repository_owner == 'searxng' || github.event_name == 'workflow_dispatch'
  17. name: Registry
  18. runs-on: ubuntu-24.04
  19. permissions:
  20. # Organization GHCR
  21. packages: write
  22. steps:
  23. - name: Prune
  24. uses: snok/container-retention-policy@v3.0.0
  25. with:
  26. account: "${{ github.repository_owner }}"
  27. token: "${{ secrets.GITHUB_TOKEN }}"
  28. # Remove only cache images https://github.com/snok/container-retention-policy/issues/97
  29. image-names: "cache"
  30. image-tags: "!searxng*"
  31. cut-off: "1d"
  32. keep-n-most-recent: "100"