Skip to content

Commit

Permalink
Add "Doc Cleanup" action (#1)
Browse files Browse the repository at this point in the history
* Add 'Doc Cleanup' action

* Update pattern
  • Loading branch information
eliascarv authored Oct 3, 2023
1 parent ff7eec7 commit 06a6d2a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/DocCleanup.yml
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

0 comments on commit 06a6d2a

Please sign in to comment.