Skip to content

Commit

Permalink
enable docs previews for PRs + github action to delete previews after…
Browse files Browse the repository at this point in the history
… PRs merge
  • Loading branch information
navidcy authored Feb 23, 2024
1 parent 6819643 commit 97d5556
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/DocPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ makedocs(;
)

deploydocs(;
repo="github.com/numericalEFT/FeynmanDiagram.jl"
repo="github.com/numericalEFT/FeynmanDiagram.jl",
push_preview=true
)

0 comments on commit 97d5556

Please sign in to comment.