Doc Cleanup #3
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: Doc Cleanup | |
on: | |
push: | |
branches: | |
- gh-pages | |
workflow_dispatch: | |
jobs: | |
doc-cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Delete old docs | |
run: | | |
keep=$(readlink stable) | |
git config user.name "Documenter.jl" | |
git config user.email "documenter@juliadocs.github.io" | |
git rm -rf v[0-9]*.[0-9]* && git checkout HEAD -- $keep | |
if git commit -m "keep latest docs only" ; then | |
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) | |
git push --force origin gh-pages-new:gh-pages | |
fi |