Skip to content

Commit c3c96eb

Browse files
devmotionhyrodium
andauthored
Fix documentation (#190 with preview) (#193)
* remove mkdocs.yml * update docs/make.jl * Add preview * Update CI * Fix repo url Co-authored-by: hyrodium <hyrodium@gmail.com>
1 parent dbd440e commit c3c96eb

File tree

4 files changed

+54
-27
lines changed

4 files changed

+54
-27
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Docs Preview Cleanup
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
doc-preview-cleanup:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout gh-pages branch
12+
uses: actions/checkout@v2
13+
with:
14+
ref: gh-pages
15+
- name: Delete preview and history + push changes
16+
run: |
17+
if [ -d "previews/PR$PRNUM" ]; then
18+
git config user.name "Documenter.jl"
19+
git config user.email "documenter@juliadocs.github.io"
20+
git rm -rf "previews/PR$PRNUM"
21+
git commit -m "delete preview"
22+
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
23+
git push --force origin gh-pages-new:gh-pages
24+
fi
25+
env:
26+
PRNUM: ${{ github.event.number }}
27+

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: CI
2+
23
on:
34
pull_request:
45
branches:
@@ -7,6 +8,13 @@ on:
78
branches:
89
- master
910
tags: '*'
11+
12+
concurrency:
13+
# Skip intermediate builds: always.
14+
# Cancel intermediate builds: only if it is a pull request build.
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
1018
jobs:
1119
test:
1220
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}

docs/make.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
11
using Documenter, ReverseDiff
22

3-
makedocs(modules=[ReverseDiff], sitename="http://www.juliadiff.org/ReverseDiff.jl")
3+
makedocs(;
4+
modules=[ReverseDiff],
5+
sitename="ReverseDiff.jl",
6+
format=Documenter.HTML(;
7+
prettyurls=get(ENV, "CI", nothing) == "true",
8+
canonical="http://www.juliadiff.org/ReverseDiff.jl",
9+
),
10+
pages=[
11+
"Home" => "index.md",
12+
"Limitation of ReverseDiff" => "limits.md",
13+
"API" => "api.md",
14+
],
15+
strict=true,
16+
checkdocs=:exports,
17+
)
18+
19+
deploydocs(;
20+
repo="github.com/JuliaDiff/ReverseDiff.jl", push_preview=true,
21+
)

docs/mkdocs.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)