Skip to content

.github/workflows/clean.yaml #30

.github/workflows/clean.yaml

.github/workflows/clean.yaml #30

Workflow file for this run

# Deletes all folders older than 2 weeks
on:
# Runs every day
schedule:
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Delete pages older than 2 weeks
run: |
git log --before="28 days ago" --pretty="" --name-only | grep -v '^.github/' | grep -v '^.git/' | xargs -d '\n' rm -f
- uses: EndBug/add-and-commit@v9