@@ -57,26 +57,34 @@ MultiDocumenter.make(
5757cp (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` )
6163outbranch = " branch-multidoc"
6264has_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 "
7371end
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 .` )
7780if 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` )
8088else
8189 @info " No changes to aggregated documentation."
82- end
90+ end
0 commit comments