Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy from workflow_dispatch builds #1752

Merged
merged 5 commits into from
Jan 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

* ![Enhancement][badge-enhancement] Documenter now deploys documentation from manually triggered events (`workflow_dispatch` on GitHub actions). ([#1554][github-1554], [#1752][github-1752])
* ![Enhancement][badge-enhancement] MathJax 3 has been updated to `v3.2.0` (minor version bump). ([#1743][github-1743])
* ![Enhancement][badge-enhancement] HTML code blocks now have a copy button. ([#1748][github-1748])
* ![Enhancement][badge-enhancement] Documenter now tries to detect the development branch using `git` with the old default (`master`) as fallback. If you use `main` as the development branch you shouldn't need to specify `devbranch = "main"` as an argument to deploydocs anymore. ([#1443][github-1443], [#1727][github-1727], [#1751][github-1751])
Expand Down Expand Up @@ -900,6 +901,7 @@
[github-1549]: https://github.com/JuliaDocs/Documenter.jl/pull/1549
[github-1551]: https://github.com/JuliaDocs/Documenter.jl/pull/1551
[github-1553]: https://github.com/JuliaDocs/Documenter.jl/pull/1553
[github-1554]: https://github.com/JuliaDocs/Documenter.jl/issues/1554
[github-1556]: https://github.com/JuliaDocs/Documenter.jl/issues/1556
[github-1557]: https://github.com/JuliaDocs/Documenter.jl/pull/1557
[github-1559]: https://github.com/JuliaDocs/Documenter.jl/pull/1559
Expand Down Expand Up @@ -953,6 +955,7 @@
[github-1743]: https://github.com/JuliaDocs/Documenter.jl/pull/1743
[github-1748]: https://github.com/JuliaDocs/Documenter.jl/pull/1748
[github-1751]: https://github.com/JuliaDocs/Documenter.jl/pull/1751
[github-1752]: https://github.com/JuliaDocs/Documenter.jl/pull/1752

[julia-38079]: https://github.com/JuliaLang/julia/issues/38079
[julia-39841]: https://github.com/JuliaLang/julia/pull/39841
Expand Down
10 changes: 5 additions & 5 deletions src/deployconfig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Implementation of `DeployConfig` for deploying from GitHub Actions.
The following environment variables influences the build
when using the `GitHubActions` configuration:

- `GITHUB_EVENT_NAME`: must be set to `push`.
- `GITHUB_EVENT_NAME`: must be set to `push` or `workflow_dispatch`.
This avoids deployment on pull request builds.

- `GITHUB_REPOSITORY`: must match the value of the `repo` keyword to [`deploydocs`](@ref).
Expand Down Expand Up @@ -327,9 +327,9 @@ function deploy_folder(cfg::GitHubActions;
println(io, "- $(marker(repo_ok)) ENV[\"GITHUB_REPOSITORY\"]=\"$(cfg.github_repository)\" occurs in repo=\"$(repo)\"")
if build_type === :release
## Do not deploy for PRs
event_ok = cfg.github_event_name == "push"
event_ok = cfg.github_event_name == "push" || cfg.github_event_name == "workflow_dispatch"
all_ok &= event_ok
println(io, "- $(marker(event_ok)) ENV[\"GITHUB_EVENT_NAME\"]=\"$(cfg.github_event_name)\" is \"push\"")
println(io, "- $(marker(event_ok)) ENV[\"GITHUB_EVENT_NAME\"]=\"$(cfg.github_event_name)\" is \"push\" or \"workflow_dispatch\"")
## If a tag exist it should be a valid VersionNumber
m = match(r"^refs\/tags\/(.*)$", cfg.github_ref)
tag_nobuild = version_tag_strip_build(m.captures[1])
Expand All @@ -343,9 +343,9 @@ function deploy_folder(cfg::GitHubActions;
subfolder = m === nothing ? nothing : tag_nobuild
elseif build_type === :devbranch
## Do not deploy for PRs
event_ok = cfg.github_event_name == "push"
event_ok = cfg.github_event_name == "push" || cfg.github_event_name == "workflow_dispatch"
all_ok &= event_ok
println(io, "- $(marker(event_ok)) ENV[\"GITHUB_EVENT_NAME\"]=\"$(cfg.github_event_name)\" is \"push\"")
println(io, "- $(marker(event_ok)) ENV[\"GITHUB_EVENT_NAME\"]=\"$(cfg.github_event_name)\" is \"push\" or \"workflow_dispatch\"")
## deploydocs' devbranch should match the current branch
m = match(r"^refs\/heads\/(.*)$", cfg.github_ref)
branch_ok = m === nothing ? false : String(m.captures[1]) == devbranch
Expand Down