From 2f55c2aeadaf089552b8ec28b93419a02a011534 Mon Sep 17 00:00:00 2001 From: Dmitry Shemetov Date: Fri, 31 Mar 2023 20:02:12 -0700 Subject: [PATCH 1/3] ci: add docs building and hosting --- .github/workflows/pkgdown.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/pkgdown.yml diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yml new file mode 100644 index 00000000..1be533fa --- /dev/null +++ b/.github/workflows/pkgdown.yml @@ -0,0 +1,46 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [dev] + pull_request: + branches: [dev] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + 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 + with: + clean: false + branch: gh-pages + folder: docs \ No newline at end of file From fe7a20a0257fba305c716ee8d2f74bdc6160de40 Mon Sep 17 00:00:00 2001 From: Dmitry Shemetov Date: Fri, 31 Mar 2023 20:05:35 -0700 Subject: [PATCH 2/3] docs: add link to docs in README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b08d0dd5..180d1963 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ [![License: MIT][mit-image]][mit-url] [![Github Actions][github-actions-image]][github-actions-url] +## Documentation + +- [Package website](https://cmu-delphi.github.io/epidatr/) + ## Install Install latest version using [`remotes`](https://cran.r-project.org/package=remotes) package From 63d403385fd6567f3b5f32c0de3aa85b3207e6ea Mon Sep 17 00:00:00 2001 From: "Logan C. Brooks" Date: Wed, 5 Apr 2023 12:20:56 -0700 Subject: [PATCH 3/3] Use `usethis::use_github_action("pkgdown")` for pkgdown ci rather than manually copying files. This should be easier to update. --- .github/.gitignore | 1 + .github/workflows/{pkgdown.yml => pkgdown.yaml} | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .github/.gitignore rename .github/workflows/{pkgdown.yml => pkgdown.yaml} (93%) diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 00000000..2d19fc76 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yml b/.github/workflows/pkgdown.yaml similarity index 93% rename from .github/workflows/pkgdown.yml rename to .github/workflows/pkgdown.yaml index 1be533fa..087f0b05 100644 --- a/.github/workflows/pkgdown.yml +++ b/.github/workflows/pkgdown.yaml @@ -2,9 +2,9 @@ # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: - branches: [dev] + branches: [main, master] pull_request: - branches: [dev] + branches: [main, master] release: types: [published] workflow_dispatch: @@ -43,4 +43,4 @@ jobs: with: clean: false branch: gh-pages - folder: docs \ No newline at end of file + folder: docs