From 6db17b7329e9bcab0ebd2bb7b8791b44073a821f Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 14 Jan 2022 21:30:24 +0100 Subject: [PATCH 1/4] deploy from `workflow_dispatch` builds --- src/deployconfig.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/deployconfig.jl b/src/deployconfig.jl index f253d8e0c2..34e109f02d 100644 --- a/src/deployconfig.jl +++ b/src/deployconfig.jl @@ -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). @@ -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]) @@ -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 From ba74586a15e5836caf00e07365d7e2245f390841 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 14 Jan 2022 21:34:58 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a0de06c74..4b1806c6b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +* ![Feature][badge-feature] You can now manually trigger deployments using github actions `workflow_dispatch` event trigger * ![Enhancement][badge-enhancement] MathJax 3 has been updated to `v3.2.0` (minor version bump). ([#1743][github-1743]) * ![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]) From e6b3a8b859dc9b1dd09cdd5a6ee729180aef659d Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Fri, 14 Jan 2022 22:04:55 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b1806c6b4..275078736d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -* ![Feature][badge-feature] You can now manually trigger deployments using github actions `workflow_dispatch` event trigger +* ![Enhancement][badge-enhancement] You can now manually trigger deployments using github actions `workflow_dispatch` event trigger * ![Enhancement][badge-enhancement] MathJax 3 has been updated to `v3.2.0` (minor version bump). ([#1743][github-1743]) * ![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]) From d61f15d5df6a28c86b95c3c3f819bc01e3e926a6 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Sat, 15 Jan 2022 16:39:02 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 275078736d..bdd48bc8e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -* ![Enhancement][badge-enhancement] You can now manually trigger deployments using github actions `workflow_dispatch` event trigger +* ![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] 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]) @@ -900,6 +900,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 @@ -952,6 +953,7 @@ [github-1727]: https://github.com/JuliaDocs/Documenter.jl/pull/1727 [github-1743]: https://github.com/JuliaDocs/Documenter.jl/pull/1743 [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