Skip to content

Commit 0f84999

Browse files
authored
Add CleanupDocPreview CI action (#246)
1 parent cdca561 commit 0f84999

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Cleanup Doc Preview
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
cleanup-doc-preview:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v3
13+
with:
14+
ref: gh-pages
15+
- name: Delete preview
16+
run: |
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "Documenter.jl"
19+
git config user.email "[email protected]"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview for $PRNUM"
22+
git push origin gh-pages:gh-pages
23+
fi
24+
env:
25+
PRNUM: ${{ github.event.number }}
26+
27+
# adapted from here:
28+
# https://juliadocs.github.io/Documenter.jl/stable/man/hosting/#gh-pages-Branch
29+
# without history cleanup

0 commit comments

Comments
 (0)