Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/DocPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Doc Preview Cleanup

on:
pull_request:
Comment thread
efaulhaber marked this conversation as resolved.
types: [closed]

# Ensure that only one "Doc Preview Cleanup" workflow is force pushing at a time
concurrency:
Comment thread
efaulhaber marked this conversation as resolved.
group: doc-preview-cleanup
cancel-in-progress: false

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
Comment thread
efaulhaber marked this conversation as resolved.
Outdated
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "${preview_dir}" ]; then
git config user.name "Documenter.jl"
git config user.email "documenter@juliadocs.github.io"
git rm -rf "${preview_dir}"
Comment thread
efaulhaber marked this conversation as resolved.
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:
preview_dir: previews/PR${{ github.event.number }}
5 changes: 5 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,10 @@ makedocs(sitename="TrixiParticles.jl",
"References" => "references.md"
])

# Simulations in the doctests and literate tutorials generate VTK and other output files
Comment thread
efaulhaber marked this conversation as resolved.
# in `docs/build/tutorials/out`.
# Do not commit these files to `gh-pages` for every documentation preview.
Comment thread
efaulhaber marked this conversation as resolved.
Outdated
rm(joinpath("docs", "build", "tutorials", "out"); recursive=true, force=true)
Comment thread
efaulhaber marked this conversation as resolved.

deploydocs(repo="github.com/trixi-framework/TrixiParticles.jl",
devbranch="main", push_preview=true)
Loading