Skip to content

Commit 104db4b

Browse files
committed
Test as multi
1 parent dccfe6e commit 104db4b

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

.github/workflows/multidocs.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@ jobs:
139139
echo "tutorials: objects.inv does not exist!" && exit 1
140140
fi
141141
142-
- name: Initialize Git in build folders
143-
run: |
144-
for dir in GNNGraphs/docs/build GNNlib/docs/build GNNLux/docs/build tutorials/docs/build GraphNeuralNetworks/docs/build; do
145-
git -C $dir init
146-
done
147-
148142
# Build and deploy multidocs
149143
- name: Install dependencies for multidocs
150144
run: julia --project=docs/ -e '

docs/make-multi.jl

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,26 +57,34 @@ MultiDocumenter.make(
5757
cp(joinpath(@__DIR__, "logo.svg"),
5858
joinpath(outpath, "logo.svg"))
5959

60-
@warn "Deploying to GitHub as in DataToolkit"
60+
@warn "Deploying to GitHub as MultiDocumenter"
61+
gitroot = normpath(joinpath(@__DIR__, ".."))
62+
run(`git pull`)
6163
outbranch = "branch-multidoc"
6264
has_outbranch = true
63-
64-
if !success(`git checkout --orphan $outbranch`)
65+
if !success(`git checkout $outbranch`)
6566
has_outbranch = false
66-
@info "Creating orphaned branch $outbranch"
6767
if !success(`git switch --orphan $outbranch`)
6868
@error "Cannot create new orphaned branch $outbranch."
6969
exit(1)
7070
end
71-
else
72-
@info "Switched to orphaned branch $outbranch"
7371
end
74-
75-
run(`git add --all`)
76-
72+
for file in readdir(gitroot; join = true)
73+
endswith(file, ".git") && continue
74+
rm(file; force = true, recursive = true)
75+
end
76+
for file in readdir(outpath)
77+
cp(joinpath(outpath, file), joinpath(gitroot, file))
78+
end
79+
run(`git add .`)
7780
if success(`git commit -m 'Aggregate documentation'`)
7881
@info "Pushing updated documentation."
79-
run(`git push origin --force $outbranch`)
82+
if has_outbranch
83+
run(`git push`)
84+
else
85+
run(`git push -u origin $outbranch`)
86+
end
87+
run(`git checkout main`)
8088
else
8189
@info "No changes to aggregated documentation."
82-
end
90+
end

0 commit comments

Comments
 (0)