File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -42,16 +42,21 @@ jobs:
42
42
needs : website
43
43
44
44
- name : Build site
45
+ # - target_ref gets the ref from a different variable, depending on the event
46
+ # - override allows us to set the pkgdown mode and version_label
47
+ # - mode: release is the standard build mode, devel places the site in /dev
48
+ # - version_label: 'light' and 'success' are CSS labels for Bootswatch: Cosmo
49
+ # https://bootswatch.com/cosmo/
50
+ # - we use pkgdown:::build_github_pages to build the site because of an issue in pkgdown
51
+ # https://github.com/r-lib/pkgdown/issues/2257
45
52
run : |
46
- target_ref <- if (startsWith("${{ github.event_name }}", "pull_request")) {
47
- "${{ github.base_ref }}"
48
- } else {
49
- "${{ github.ref }}"
50
- }
53
+ target_ref <- ${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}
51
54
override <- if (target_ref == "main") {
52
55
list(development = list(mode = "release", version_label = "light"))
53
- } else {
56
+ } else if (target_ref == "dev") {
54
57
list(development = list(mode = "devel", version_label = "success"))
58
+ } else {
59
+ stop("Unexpected target_ref: ", target_ref)
55
60
}
56
61
pkg <- pkgdown::as_pkgdown(".", override = override)
57
62
cli::cli_rule("Cleaning files from old site...")
You can’t perform that action at this time.
0 commit comments