File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Documentation Preview Cleanup
2+
3+ on :
4+ pull_request :
5+ types : [closed]
6+ # Ensure that only one "Documentation Preview Cleanup" workflow is force pushing at a time
7+ concurrency :
8+ group : doc-preview-cleanup
9+ cancel-in-progress : false
10+
11+ jobs :
12+ doc-preview-cleanup :
13+ runs-on : ubuntu-latest
14+ permissions :
15+ contents : write
16+ steps :
17+ - name : Checkout gh-pages branch
18+ uses : actions/checkout@v6
19+ with :
20+ ref : gh-pages
21+ - name : Delete preview and history + push changes
22+ run : |
23+ if [ -d "${preview_dir}" ]; then
24+ git config user.name "Documenter.jl"
25+ git config user.email "documenter@juliadocs.github.io"
26+ git rm -rf "${preview_dir}"
27+ git commit -m "delete preview"
28+ git branch gh-pages-new "$(echo "delete history" | git commit-tree "HEAD^{tree}")"
29+ git push --force origin gh-pages-new:gh-pages
30+ fi
31+ env :
32+ preview_dir : previews/PR${{ github.event.number }}
You can’t perform that action at this time.
0 commit comments