diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 6e2d0169..5cad4a9a 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -23,7 +23,7 @@ jobs: group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - DELPHI_EPIDATA_KEY: ${{ secrets.DELPHI_GITHUB_ACTIONS_EPIDATA_API_KEY }} + DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }} steps: - uses: actions/checkout@v3 @@ -35,19 +35,21 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: any::pkgdown, local::. + extra-packages: any::pkgdown, local::., any::cli needs: website - name: Build site - env: - DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIDATR_GHACTIONS_DELPHI_EPIDATA_KEY }} run: | if (startsWith("${{ github.event_name }}", "pull_request")) { - mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel") + mode_ref <- ifelse("${{ github.base_ref }}" == "main", "release", "devel") } else { - mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel") + mode_ref <- ifelse("${{ github.ref_name }}" == "main", "release", "devel") } - pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode)) + pkg <- pkgdown::as_pkgdown(".", override = list(destination = ifelse(mode_ref == "release", "docs", "docs/dev"), PKGDOWN_DEV_MODE = mode_ref)) + 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 🚀 diff --git a/R/utils.R b/R/utils.R index 5f7ab3d3..15356734 100644 --- a/R/utils.R +++ b/R/utils.R @@ -70,5 +70,10 @@ get_wildcard_equivalent_dates <- function(time_value, time_type = c("day", "week #' inserts each string as a bullet at the end of the "Prepare for release" section #' @keywords internal release_bullets <- function() { - c("merge to main") + c( + "merge to main", + "don't use_version('patch') in the next section", + "`use_version('patch')` is redundant because we do this in PRs", + "`use_dev_version` is also redundant." + ) } diff --git a/_pkgdown.yml b/_pkgdown.yml index f923ad58..1d71aea0 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,5 +1,7 @@ # Colors should stay consistent across epipredict & epidatr, using Carnegie # Red https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html +development: + mode: devel template: bootstrap: 5 bootswatch: cosmo