Skip to content

Delete old folders from GitHub Pages #30

Delete old folders from GitHub Pages

Delete old folders from GitHub Pages #30

Workflow file for this run

name: Delete old folders from GitHub Pages
on:
push:
branches:
- "gh-pages"
schedule:
- cron: '0 0 * * *' # This will run the workflow daily at midnight UTC
jobs:
delete_old_folders:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Get current directory
run: echo "CURRENT_DIR=$(pwd)" >> $GITHUB_ENV
- name: Run the script
run: python rm_old_folders.py --n-days 30 --folder-name "${{ env.CURRENT_DIR }}"
- name: Commit all changed files back to the repository
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: gh-pages
commit_message: Delete folders older than 30 days
notify_on_delete_pages_failure:
runs-on: ubuntu-latest
needs:
- delete_old_folders
if: failure()
steps:
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_TITLE: ":boom: The nightly delete of expired Playwright reports job has failed in ${{ github.repository }}."
MSG_MINIMAL: true
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}"