Skip to content

Commit 19e63cb

Browse files
authored
houseclean: forcepush when deploying documentation (#213)
also add a docsclean CI to remove generated previews
1 parent 3156324 commit 19e63cb

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/DocCleanup.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow was taken from CliMA/TimeMachine.jl (Apache License 2.0).
2+
# Change note:
3+
# JuliaImages documentation somehow uses master branch instead of gh-pages branch.
4+
name: Doc Preview Cleanup
5+
6+
on:
7+
pull_request:
8+
types: [closed]
9+
10+
jobs:
11+
doc-preview-cleanup:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout master branch
15+
uses: actions/checkout@v2
16+
with:
17+
ref: master
18+
- name: Delete preview and history + push changes
19+
run: |
20+
if [ -d "previews/PR$PRNUM" ]; then
21+
git config user.name "Documenter.jl"
22+
git config user.email "[email protected]"
23+
git rm -rf "previews/PR$PRNUM"
24+
git commit -m "delete preview"
25+
git branch master-new $(echo "delete history" | git commit-tree HEAD^{tree})
26+
git push --force origin master-new:master
27+
fi
28+
env:
29+
PRNUM: ${{ github.event.number }}

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ deploydocs(repo = "github.com/JuliaImages/juliaimages.github.io.git",
4747
target = "build",
4848
branch = branch,
4949
push_preview = true,
50+
forcepush = true,
5051
devbranch = "source",
5152
deps = nothing,
5253
make = nothing)

0 commit comments

Comments
 (0)