From a2f2f448c639334767c7fbaa2e28bd7f69b0bd53 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Mon, 11 Nov 2024 16:19:58 -0800 Subject: [PATCH 1/5] delphidocs on dev --- .github/workflows/pkgdown.yaml | 26 +++---------------- _pkgdown.yml | 46 +++++++++++----------------------- 2 files changed, 18 insertions(+), 54 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 886055ae..3a1ff927 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -28,7 +28,7 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -42,32 +42,12 @@ jobs: needs: website - name: Build site - # - target_ref gets the ref from a different variable, depending on the event - # - override allows us to set the pkgdown mode and version_label - # - mode: release is the standard build mode, devel places the site in /dev - # - version_label: 'light' and 'success' are CSS labels for Bootswatch: Cosmo - # https://bootswatch.com/cosmo/ - # - we use pkgdown:::build_github_pages to build the site because of an issue in pkgdown - # https://github.com/r-lib/pkgdown/issues/2257 - 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", version_label = "light")) - } else if (target_ref == "dev" || target_ref == "refs/heads/dev") { - list(development = list(mode = "devel", version_label = "success")) - } 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) + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - name: Deploy to GitHub pages 🚀 if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.5.0 with: clean: false branch: gh-pages diff --git a/_pkgdown.yml b/_pkgdown.yml index 2214df7c..743adc4b 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,40 +1,25 @@ -# Colors should stay consistent across epipredict, epiprocess, and epidatr, -# using Carnegie Red -# https://www.cmu.edu/brand/brand-guidelines/visual-identity/colors.html - -# This is to give a default value to the `mode` parameter in the -# `pkgdown::build_site` function. This is useful when building the site locally, -# as it will default to `devel` mode. In practice, this should all be handled -# dynamically by the CI/CD pipeline. development: - mode: devel - version_label: success + mode: auto template: - bootstrap: 5 - bootswatch: cosmo - bslib: - font_scale: 1.0 - primary: "#C41230" - success: "#B4D43C" - link-color: "#C41230" - -navbar: - bg: primary - type: light + package: delphidocs url: https://cmu-delphi.github.io/epiprocess/ home: links: - - text: Introduction to Delphi's Tooling Work - href: https://cmu-delphi.github.io/delphi-tooling-book/ - - text: Get the epipredict R package + - text: The epipredict package href: https://cmu-delphi.github.io/epipredict/ - - text: Get the epidatr R package - href: https://github.com/cmu-delphi/epidatr - - text: Get the epidatasets R package - href: https://cmu-delphi.github.io/epidatasets/ + sidebar: + structure: [links, license, community, citation, authors, dev, related] + components: + related: + title: Delphi packages and resources + text: | + * [The epidatr package](https://github.com/cmu-delphi/epidatr/) + * [The epipredict package](https://cmu-delphi.github.io/epipredict/) + * [The epidatasets package](https://cmu-delphi.github.io/epidatasets/) + * [Introduction to Delphi's Tooling Work](https://cmu-delphi.github.io/delphi-tooling-book/) articles: - title: Using the package @@ -54,10 +39,9 @@ articles: repo: url: - home: https://github.com/cmu-delphi/epiprocess/tree/main/ - source: https://github.com/cmu-delphi/epiprocess/blob/main/ + home: https://github.com/cmu-delphi/epiprocess/ + source: https://github.com/cmu-delphi/epiprocess/ issue: https://github.com/cmu-delphi/epiprocess/issues - user: https://github.com/ reference: - title: "`epi_df` basics" From 97d17e8859588c81ae9ca662186e93dad5472ccd Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 13 Nov 2024 08:02:50 -0800 Subject: [PATCH 2/5] back to our custom workflow, no color handling --- .github/workflows/pkgdown.yaml | 17 ++++++++++++++++- _pkgdown.yml | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 3a1ff927..e9bfcc71 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -42,7 +42,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 🚀 diff --git a/_pkgdown.yml b/_pkgdown.yml index 743adc4b..a7d700e1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,5 +1,5 @@ development: - mode: auto + mode: devel template: package: delphidocs From f858ff9a5ced4b0db8e7740621b061baa71af6ab Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 13 Nov 2024 08:03:58 -0800 Subject: [PATCH 3/5] rm spaces --- .github/workflows/pkgdown.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index e9bfcc71..19542ace 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -45,19 +45,19 @@ jobs: # 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) + 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 🚀 From 2eaa5eb8b6dd2f7269e1187692010dad3fff3c08 Mon Sep 17 00:00:00 2001 From: "Daniel J. McDonald" Date: Wed, 13 Nov 2024 08:08:11 -0800 Subject: [PATCH 4/5] delphidocs in description --- DESCRIPTION | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DESCRIPTION b/DESCRIPTION index fd09aa57..8917f800 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -72,10 +72,12 @@ Suggests: VignetteBuilder: knitr Remotes: + cmu-delphi/delphidocs, cmu-delphi/epidatasets, cmu-delphi/epidatr, glmgen/genlasso, reconverse/outbreaks +Config/Needs/website: cmu-delphi/delphidocs Config/testthat/edition: 3 Config/testthat/parallel: true Copyright: file inst/COPYRIGHTS From 4970ff4a7809ecc309e485e48677bbcc1d1f3f93 Mon Sep 17 00:00:00 2001 From: "Logan C. Brooks" Date: Wed, 13 Nov 2024 16:28:03 -0800 Subject: [PATCH 5/5] style(.../workflows/pkgdown.yaml): indentation --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 19542ace..1381682d 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -42,7 +42,7 @@ jobs: needs: website - name: Build site -# our versioning system+dev branch doesn't match the requirements for + # 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 }}"