Clear cache weekly #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clear cache weekly | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/call-clear-cache.yml" | |
workflow_dispatch: | |
inputs: | |
pattern: | |
description: "pattern for cleaning cache" | |
default: "pip-|conda" | |
required: false | |
type: string | |
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" | |
jobs: | |
cron-clear: | |
if: github.event_name == 'schedule' || github.event_name == 'pull_request' | |
uses: Lightning-AI/utilities/.github/workflows/[email protected] | |
with: | |
scripts-ref: v0.11.6 | |
dry-run: ${{ github.event_name == 'pull_request' }} | |
pattern: "latest|docs" | |
age-days: 7 | |
direct-clear: | |
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' | |
uses: Lightning-AI/utilities/.github/workflows/[email protected] | |
with: | |
scripts-ref: v0.11.6 | |
dry-run: ${{ github.event_name == 'pull_request' }} | |
pattern: ${{ inputs.pattern || 'pypi_wheels' }} # setting str in case of PR / debugging | |
age-days: ${{ fromJSON(inputs.age-days) || 0 }} # setting 0 in case of PR / debugging |