Skip to content

Commit a4d9ab4

Browse files
authored
Merge pull request #23 from JuliaComputing/sp/deploy
Add deploy step to CI
2 parents 3356a29 + 77e189e commit a4d9ab4

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Aggregate
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
aggregate:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: julia-actions/setup-julia@v1
12+
with:
13+
version: '1.8'
14+
- uses: actions/cache@v1
15+
env:
16+
cache-name: cache-artifacts
17+
with:
18+
path: ~/.julia/artifacts
19+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
20+
restore-keys: |
21+
${{ runner.os }}-test-${{ env.cache-name }}-
22+
${{ runner.os }}-test-
23+
${{ runner.os }}-
24+
- name: Install dependencies
25+
run: julia --project=. -e 'using Pkg; Pkg.instantiate()'
26+
- name: Aggregate and deploy
27+
run: julia --project=. docs/make.jl

docs/make.jl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
using MultiDocumenter
2+
3+
clonedir = mktempdir()
4+
5+
docs = [
6+
MultiDocumenter.DropdownNav("Debugging", [
7+
MultiDocumenter.MultiDocRef(
8+
upstream = joinpath(clonedir, "Infiltrator"),
9+
path = "inf",
10+
name = "Infiltrator",
11+
giturl = "https://github.com/JuliaDebug/Infiltrator.jl.git",
12+
),
13+
MultiDocumenter.MultiDocRef(
14+
upstream = joinpath(clonedir, "JuliaInterpreter"),
15+
path = "debug",
16+
name = "JuliaInterpreter",
17+
giturl = "https://github.com/JuliaDebug/JuliaInterpreter.jl.git",
18+
),
19+
]),
20+
MultiDocumenter.MultiDocRef(
21+
upstream = joinpath(clonedir, "DataSets"),
22+
path = "data",
23+
name = "DataSets",
24+
giturl = "https://github.com/JuliaComputing/DataSets.jl.git",
25+
# or use ssh instead for private repos:
26+
# giturl = "[email protected]:JuliaComputing/DataSets.jl.git",
27+
),
28+
]
29+
30+
outpath = mktempdir()
31+
32+
MultiDocumenter.make(
33+
outpath,
34+
docs;
35+
search_engine = MultiDocumenter.SearchConfig(
36+
index_versions = ["stable"],
37+
engine = MultiDocumenter.FlexSearch
38+
)
39+
)
40+
41+
gitroot = normpath(joinpath(@__DIR__, ".."))
42+
try
43+
run(`git checkout gh-pages`)
44+
catch err
45+
# branch probably doesn't exist
46+
run(`git checkout -b gh-pages`)
47+
end
48+
for file in readdir(gitroot; join = true)
49+
endswith(file, ".git") && continue
50+
rm(file; force = true, recursive = true)
51+
end
52+
for file in readdir(outpath)
53+
cp(joinpath(outpath, file), joinpath(gitroot, file))
54+
end
55+
run(`git add .`)
56+
run(`git commit -m 'Aggregate documentation'`)
57+
run(`git push`)
58+
run(`git checkout main`)

0 commit comments

Comments
 (0)