Skip to content

Commit e4ca291

Browse files
authored
Merge pull request #263 from cmu-delphi/ds/ci
ci: fix pkgdown
2 parents a920a76 + e63a926 commit e4ca291

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/pkgdown.yaml

+9-7
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2424
env:
2525
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
26-
DELPHI_EPIDATA_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }}
26+
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }}
2727
steps:
2828
- uses: actions/checkout@v3
2929

@@ -35,19 +35,21 @@ jobs:
3535

3636
- uses: r-lib/actions/setup-r-dependencies@v2
3737
with:
38-
extra-packages: any::pkgdown, local::.
38+
extra-packages: any::pkgdown, local::., any::cli
3939
needs: website
4040

4141
- name: Build site
42-
env:
43-
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }}
4442
run: |
4543
if (startsWith("${{ github.event_name }}", "pull_request")) {
46-
mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
44+
mode_ref <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
4745
} else {
48-
mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
46+
mode_ref <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
4947
}
50-
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode))
48+
pkg <- pkgdown::as_pkgdown(".", override = list(destination = ifelse(mode_ref == "release", "docs", "docs/dev"), PKGDOWN_DEV_MODE = mode_ref))
49+
cli::cli_rule("Cleaning files from old site...")
50+
pkgdown::clean_site(pkg)
51+
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
52+
pkgdown:::build_github_pages(pkg)
5153
shell: Rscript {0}
5254

5355
- name: Deploy to GitHub pages 🚀

R/utils.R

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,10 @@ get_wildcard_equivalent_dates <- function(time_value, time_type = c("day", "week
7070
#' inserts each string as a bullet at the end of the "Prepare for release" section
7171
#' @keywords internal
7272
release_bullets <- function() {
73-
c("merge to main")
73+
c(
74+
"merge to main",
75+
"don't use_version('patch') in the next section",
76+
"`use_version('patch')` is redundant because we do this in PRs",
77+
"`use_dev_version` is also redundant."
78+
)
7479
}

_pkgdown.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Colors should stay consistent across epipredict & epidatr, using Carnegie
22
# Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html
3+
development:
4+
mode: devel
35
template:
46
bootstrap: 5
57
bootswatch: cosmo

0 commit comments

Comments
 (0)