Skip to content

Commit 437e2c7

Browse files
committed
annoying workaround needs to come back
1 parent ddc8083 commit 437e2c7

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/workflows/pkgdown.yaml

+16-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,22 @@ jobs:
4040
needs: website
4141

4242
- name: Build site
43-
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
43+
# our versioning system+dev branch doesn't match the requirements for
44+
# develop mode = auto
45+
run: |
46+
target_ref <- "${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}"
47+
override <- if (target_ref == "main" || target_ref == "refs/heads/main") {
48+
list(development = list(mode = "release"))
49+
} else if (target_ref == "dev" || target_ref == "refs/heads/dev") {
50+
list(development = list(mode = "devel"))
51+
} else {
52+
stop("Unexpected target_ref: ", target_ref)
53+
}
54+
pkg <- pkgdown::as_pkgdown(".", override = override)
55+
cli::cli_rule("Cleaning files from old site...")
56+
pkgdown::clean_site(pkg)
57+
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
58+
pkgdown:::build_github_pages(pkg)
4459
shell: Rscript {0}
4560

4661
- name: Deploy to GitHub pages 🚀

_pkgdown.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
url: https://cmu-delphi.github.io/epipredict/
22

33
development:
4-
mode: auto
4+
mode: devel
55

66
template:
77
package: delphidocs

0 commit comments

Comments
 (0)