Clear caches older than 5 days (#8494)
This commit is contained in:
parent
0ca332ba4a
commit
1ed21d10db
1 changed files with 12 additions and 3 deletions
15
.github/workflows/cleanup-cache.yml
vendored
15
.github/workflows/cleanup-cache.yml
vendored
|
@ -1,19 +1,28 @@
|
|||
name: Cleanup cache
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 11 * * *"
|
||||
pull_request:
|
||||
types:
|
||||
- closed
|
||||
|
||||
# Workflow copied from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Cleanup
|
||||
|
||||
- name: Cleanup caches older than 5 days
|
||||
if: github.event_name == 'schedule'
|
||||
uses: MyAlbum/purge-cache@v2
|
||||
with:
|
||||
max-age: 432000
|
||||
|
||||
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
|
||||
- name: Cleanup on PR close
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
gh extension install actions/gh-actions-cache
|
||||
|
||||
|
|
Loading…
Reference in a new issue