Skip to content

Commit ad8cf8d

Browse files
authored
Upgrade doc/make.jl to introspect branch/tag names from git… (#32823)
Upgrade `doc/make.jl` to introspect branch/tag names from git info
2 parents c83c3c7 + c6f1b65 commit ad8cf8d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/make.jl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,19 @@ makedocs(
191191
# Only deploy docs from 64bit Linux to avoid committing multiple versions of the same
192192
# docs from different workers.
193193
if "deploy" in ARGS && Sys.ARCH === :x86_64 && Sys.KERNEL === :Linux
194-
# Override TRAVIS_REPO_SLUG since we deploy to a different repo
195-
withenv("TRAVIS_REPO_SLUG" => "JuliaLang/docs.julialang.org") do
194+
195+
# Override a few environment variables to deploy to the appropriate repository,
196+
# encode things like branch, whether it's built on a tag, etc....
197+
env_mappings = [
198+
"TRAVIS_REPO_SLUG" => "JuliaLang/docs.julialang.org",
199+
"TRAVIS_BRANCH" => Base.GIT_VERSION_INFO.branch,
200+
]
201+
202+
if Base.GIT_VERSION_INFO.tagged_commit
203+
push!(env_mappings, "TRAVIS_TAG" => string(Base.VERSION))
204+
end
205+
206+
withenv(env_mappings...) do
196207
deploydocs(
197208
repo = "github.com/JuliaLang/docs.julialang.org.git",
198209
target = joinpath(buildroot, "doc", "_build", "html", "en"),

0 commit comments

Comments
 (0)