@@ -8,7 +8,7 @@ using LibGit2, Pkg, TOML, UUIDs, Downloads
8
8
# That way, docs for all packages are browsable and searchable in one place!
9
9
10
10
clonedir = (" --temp" in ARGS ) ? mktempdir () : joinpath (@__DIR__ , " clones" )
11
- outpath = joinpath (@__DIR__ , " out" )
11
+ outpath = ( " --temp " in ARGS ) ? mktempdir () : joinpath (@__DIR__ , " out" )
12
12
@info """
13
13
Cloning packages into: $(clonedir)
14
14
Building aggregate site into: $(outpath)
@@ -264,46 +264,48 @@ Downloads.download(
264
264
)
265
265
@info " Final build done"
266
266
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"
303
305
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