forked from TuringLang/Turing.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.jl
53 lines (44 loc) · 1.41 KB
/
make.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Documenter, DocumenterMarkdown, Turing, AdvancedHMC, Bijectors
using LibGit2: clone
# Include the utility functions.
include("make-utils.jl")
# Paths.
source_path = joinpath(@__DIR__, "src")
build_path = joinpath(@__DIR__, "_docs")
tutorial_path = joinpath(@__DIR__, "_tutorials")
with_clean_docs(source_path, build_path) do source, build
makedocs(
sitename = "Turing.jl",
source = source,
build = build,
format = Markdown(),
checkdocs = :all
)
end
# You can skip this part if you are on a metered
# connection by calling `julia make.jl no-tutorials`
in("no-tutorials", ARGS) || copy_tutorial(tutorial_path)
# set default baseurl for the master branch
baseurl = "/dev"
# set baseurl for version tag when current head is tagged
vtag = get(ENV, "TRAVIS_TAG", "") # if on Travis
if isempty(vtag) # so we are using GitHub Actions
vtag = replace(get(ENV, "GITHUB_REF", ""), r"/?refs/tags/?" => "")
end
version_match = match(r"^(v\d+\.\d+\.\d+)$", vtag)
if !isnothing(version_match)
baseurl = "/" * version_match[1]
end
jekyll_build = joinpath(@__DIR__, "jekyll-build")
with_baseurl(() -> run(`$jekyll_build`), baseurl)
# deploy
devurl = "dev"
repo = "github.com:TuringLang/Turing.jl.git"
deploydocs(
target = "_site",
repo = repo,
branch = "gh-pages",
devbranch = "master",
devurl = devurl,
versions = ["stable" => "v^", "v#.#", devurl => devurl]
)