Skip to content

Commit 44338f2

Browse files
committed
back to manual deploy
1 parent b6c6915 commit 44338f2

File tree

2 files changed

+50
-44
lines changed

2 files changed

+50
-44
lines changed

.github/workflows/Documentation.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ jobs:
1717
- uses: julia-actions/cache@v2
1818
- name: Install dependencies
1919
run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate()'
20-
- uses: julia-actions/julia-docdeploy@v1
20+
- name: Aggregate and deploy
21+
run: |
22+
git config user.name github-actions
23+
git config user.email [email protected]
24+
julia --project=docs docs/make.jl --deploy --temp
2125
env:
2226
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
2327
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/make.jl

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using LibGit2, Pkg, TOML, UUIDs, Downloads
88
# That way, docs for all packages are browsable and searchable in one place!
99

1010
clonedir = ("--temp" in ARGS) ? mktempdir() : joinpath(@__DIR__, "clones")
11-
outpath = joinpath(@__DIR__, "out")
11+
outpath = ("--temp" in ARGS) ? mktempdir() : joinpath(@__DIR__, "out")
1212
@info """
1313
Cloning packages into: $(clonedir)
1414
Building aggregate site into: $(outpath)
@@ -264,46 +264,48 @@ Downloads.download(
264264
)
265265
@info "Final build done"
266266

267-
#if "deploy" in ARGS
268-
# @warn "Deploying to GitHub" ARGS
269-
# gitroot = normpath(joinpath(@__DIR__, ".."))
270-
# run(`git pull`)
271-
# outbranch = "master"
272-
# has_outbranch = true
273-
# if !success(`git checkout $outbranch`)
274-
# has_outbranch = false
275-
# if !success(`git switch --orphan $outbranch`)
276-
# @error "Cannot create new orphaned branch $outbranch."
277-
# exit(1)
278-
# end
279-
# end
280-
# for file in readdir(gitroot; join = true)
281-
# endswith(file, ".git") && continue
282-
# rm(file; force = true, recursive = true)
283-
# end
284-
# for file in readdir(outpath)
285-
# cp(joinpath(outpath, file), joinpath(gitroot, file))
286-
# end
287-
# run(`git add .`)
288-
# if success(`git commit -m 'Aggregate documentation'`)
289-
# @info "Pushing updated documentation."
290-
# if has_outbranch
291-
# run(`git push`)
292-
# else
293-
# run(`git push -u origin $outbranch`)
294-
# end
295-
# run(`git checkout source`)
296-
# else
297-
# @info "No changes to aggregated documentation."
298-
# end
299-
#else
300-
# @info "Skipping deployment, 'deploy' not passed. Generated files in docs/$(outpath)." ARGS
301-
# cp(outpath, joinpath(@__DIR__, "build"), force = true)
302-
#end
267+
@info "Deployng docs"
268+
if "--deploy" in ARGS
269+
@warn "Deploying to GitHub" ARGS
270+
gitroot = normpath(joinpath(@__DIR__, ".."))
271+
run(`git pull`)
272+
outbranch = "master"
273+
has_outbranch = true
274+
if !success(`git checkout $outbranch`)
275+
has_outbranch = false
276+
if !success(`git switch --orphan $outbranch`)
277+
@error "Cannot create new orphaned branch $outbranch."
278+
exit(1)
279+
end
280+
end
281+
for file in readdir(gitroot; join = true)
282+
endswith(file, ".git") && continue
283+
rm(file; force = true, recursive = true)
284+
end
285+
for file in readdir(outpath)
286+
cp(joinpath(outpath, file), joinpath(gitroot, file))
287+
end
288+
run(`git add .`)
289+
if success(`git commit -m 'Aggregate documentation'`)
290+
@info "Pushing updated documentation."
291+
if has_outbranch
292+
run(`git push`)
293+
else
294+
run(`git push -u origin $outbranch`)
295+
end
296+
run(`git checkout source`)
297+
else
298+
@info "No changes to aggregated documentation."
299+
end
300+
else
301+
@info "Skipping deployment, 'deploy' not passed. Generated files in docs/$(outpath)." ARGS
302+
cp(outpath, joinpath(@__DIR__, "build"), force = true)
303+
end
304+
@info "Deploy complete"
303305

304-
deploydocs(;
305-
repo = "github.com/JuliaAstro/JuliaAstro.github.io",
306-
push_preview = true,
307-
branch = "master",
308-
devbranch = "multidocumenter"
309-
)
306+
#deploydocs(;
307+
# repo = "github.com/JuliaAstro/JuliaAstro.github.io",
308+
# push_preview = true,
309+
# branch = "master",
310+
# devbranch = "multidocumenter"
311+
#)

0 commit comments

Comments
 (0)