summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Bjorn Lu <bjornlu.dev@gmail.com> 2023-09-11 20:05:17 +0800
committerGravatar GitHub <noreply@github.com> 2023-09-11 20:05:17 +0800
commit1ed21d10db3f57e19861a865722d039238e82c8b (patch)
treefef483779cb6e9fbfed4dd359ca62871709b5160
parent0ca332ba4ab82cc04872776398952867b0f43d33 (diff)
downloadastro-1ed21d10db3f57e19861a865722d039238e82c8b.tar.gz
astro-1ed21d10db3f57e19861a865722d039238e82c8b.tar.zst
astro-1ed21d10db3f57e19861a865722d039238e82c8b.zip
Clear caches older than 5 days (#8494)
-rw-r--r--.github/workflows/cleanup-cache.yml15
1 files changed, 12 insertions, 3 deletions
diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml
index a3c4d25a4..cf03bbfee 100644
--- a/.github/workflows/cleanup-cache.yml
+++ b/.github/workflows/cleanup-cache.yml
@@ -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