Skip to content

Doc Previews Cleanup #19

Doc Previews Cleanup

Doc Previews Cleanup #19

name: Doc Previews Cleanup
on:
schedule:
- cron: "30 5 * * 1"
workflow_dispatch:
inputs:
lookback:
default: 3
# Ensure that only one "Doc Previews Cleanup" workflow is force pushing at a time
concurrency:
group: doc-preview-cleanup
cancel-in-progress: false
jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf previews/*
git commit -m "delete previews directory"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages