Skip to content

Commit

Permalink
annoying workaround needs to come back
Browse files Browse the repository at this point in the history
  • Loading branch information
dajmcdon committed Nov 12, 2024
1 parent ddc8083 commit 437e2c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,22 @@ jobs:
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
# our versioning system+dev branch doesn't match the requirements for
# develop mode = auto
run: |
target_ref <- "${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}"
override <- if (target_ref == "main" || target_ref == "refs/heads/main") {
list(development = list(mode = "release"))
} else if (target_ref == "dev" || target_ref == "refs/heads/dev") {
list(development = list(mode = "devel"))
} else {
stop("Unexpected target_ref: ", target_ref)
}
pkg <- pkgdown::as_pkgdown(".", override = override)
cli::cli_rule("Cleaning files from old site...")
pkgdown::clean_site(pkg)
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
pkgdown:::build_github_pages(pkg)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
url: https://cmu-delphi.github.io/epipredict/

development:
mode: auto
mode: devel

template:
package: delphidocs
Expand Down

0 comments on commit 437e2c7

Please sign in to comment.