2022-10-05 09:52:42 +00:00
|
|
|
name: Clear cache weekly
|
|
|
|
|
|
|
|
on:
|
2024-08-06 10:59:55 +00:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- ".github/workflows/call-clear-cache.yml"
|
2023-01-17 11:12:00 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
pattern:
|
2023-09-26 15:54:44 +00:00
|
|
|
description: "pattern for cleaning cache"
|
2023-02-07 15:37:34 +00:00
|
|
|
default: "pip-|conda"
|
2023-01-17 11:12:00 +00:00
|
|
|
required: false
|
|
|
|
type: string
|
2024-08-06 10:59:55 +00:00
|
|
|
age-days:
|
|
|
|
description: "setting the age of caches in days to be dropped"
|
|
|
|
required: true
|
|
|
|
type: number
|
|
|
|
default: 5
|
|
|
|
schedule:
|
|
|
|
# on Sundays
|
|
|
|
- cron: "0 0 * * 0"
|
2022-10-05 09:52:42 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-01-17 11:12:00 +00:00
|
|
|
cron-clear:
|
2024-08-06 10:59:55 +00:00
|
|
|
if: github.event_name == 'schedule' || github.event_name == 'pull_request'
|
2024-11-25 05:07:43 +00:00
|
|
|
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.9
|
2022-10-05 09:52:42 +00:00
|
|
|
with:
|
2024-10-21 14:15:01 +00:00
|
|
|
scripts-ref: v0.11.8
|
2024-08-06 10:59:55 +00:00
|
|
|
dry-run: ${{ github.event_name == 'pull_request' }}
|
2023-09-25 12:34:41 +00:00
|
|
|
pattern: "latest|docs"
|
2024-08-06 10:59:55 +00:00
|
|
|
age-days: 7
|
2023-01-17 11:12:00 +00:00
|
|
|
|
|
|
|
direct-clear:
|
2024-08-06 10:59:55 +00:00
|
|
|
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
|
2024-11-25 05:07:43 +00:00
|
|
|
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.9
|
2023-01-17 11:12:00 +00:00
|
|
|
with:
|
2024-10-21 14:15:01 +00:00
|
|
|
scripts-ref: v0.11.8
|
2024-08-06 10:59:55 +00:00
|
|
|
dry-run: ${{ github.event_name == 'pull_request' }}
|
|
|
|
pattern: ${{ inputs.pattern || 'pypi_wheels' }} # setting str in case of PR / debugging
|
2024-08-07 08:59:05 +00:00
|
|
|
age-days: ${{ fromJSON(inputs.age-days) || 0 }} # setting 0 in case of PR / debugging
|