-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add 'Doc Cleanup' action * Update pattern
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 "[email protected]" | ||
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 |