cleanup.yml 885 B

123456789101112131415161718192021222324252627282930313233343536
  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. container-cache:
  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: Container cache
  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. image-names: "cache base"
  29. image-tags: "!searxng*"
  30. cut-off: "1d"
  31. keep-n-most-recent: "100"