From 487e9fe2aaf8eebc114af2fd13a764744e4ce80c Mon Sep 17 00:00:00 2001 From: Ernest Guevarra Date: Fri, 3 Jan 2025 02:07:34 +0000 Subject: [PATCH] setup netlify workflow; fix #41 --- .github/workflows/netlify.yaml | 53 ++++++++++++++++++++++++++++++++++ DESCRIPTION | 2 +- README.Rmd | 4 ++- inst/CITATION | 2 +- man/ona_project_register.Rd | 2 +- man/ona_project_share.Rd | 4 +-- pkgdown/_pkgdown.yml | 8 +++-- 7 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/netlify.yaml diff --git a/.github/workflows/netlify.yaml b/.github/workflows/netlify.yaml new file mode 100644 index 0000000..10c6fe1 --- /dev/null +++ b/.github/workflows/netlify.yaml @@ -0,0 +1,53 @@ +on: + pull_request: + branches: [main, master] + +name: pkgdown-pr + +jobs: + netlify: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-tinytex@v2 + + - 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: Install package + run: R CMD INSTALL . + + - name: Create website + run: | + pkgdown::build_site() + shell: Rscript {0} + + - name: Create index file + run: | + echo ' ' > ./docs/index.html + + - name: Deploy to Netlify + uses: nwtgck/actions-netlify@v3.0 + with: + publish-dir: './docs' + production-branch: main + github-token: ${{ secrets.GITHUB_TOKEN }} + deploy-message: + 'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' + # these default to 'true' + enable-commit-comment: false + enable-github-deployment: false + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} diff --git a/DESCRIPTION b/DESCRIPTION index 7f7a566..430fe0f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,6 +27,6 @@ Encoding: UTF-8 Language: en-GB LazyData: true RoxygenNote: 7.3.2 -Roxygeon: list(markdown = TRUE) +Roxygen: list(markdown = TRUE) URL: https://rapidsurveys.io/okapi/,https://github.com/rapidsurveys/okapi BugReports: https://github.com/rapidsurveys/okapi/issues diff --git a/README.Rmd b/README.Rmd index 406d9d8..f1d9741 100644 --- a/README.Rmd +++ b/README.Rmd @@ -48,7 +48,9 @@ Currently, `{okapi}` provides functions to interface with [ONA](https://getodk.o ```{r install, echo = TRUE, eval = FALSE} install.packages( "okapi", - repos = c('https://rapidsurveys.r-universe.dev', 'https://cloud.r-project.org') + repos = c( + 'https://rapidsurveys.r-universe.dev', 'https://cloud.r-project.org' + ) ) ``` diff --git a/inst/CITATION b/inst/CITATION index bd72f99..31f76b3 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -4,7 +4,7 @@ bibentry( title = "okapi: Open Data Kit (ODK)-based Computer-assisted Personal Interview (CAPI) Tools", author = person("Ernest Guevarra"), year = "2024", - note = "R package version 0.0.0.9000", + note = "R package version 0.1.0.9000", url = "https://rapidsurveys.io/okapi/", doi = "10.5281/zenodo.206914853", ) \ No newline at end of file diff --git a/man/ona_project_register.Rd b/man/ona_project_register.Rd index a375cb7..f573037 100644 --- a/man/ona_project_register.Rd +++ b/man/ona_project_register.Rd @@ -19,7 +19,7 @@ ona_project_register( \item{owner}{Username or organisation name creating the project. Default to username of currently authenticated account -(via `Sys.getenv(ONA_USERNAME)`). If organisation name, should be +(via \code{Sys.getenv(ONA_USERNAME)}). If organisation name, should be an organisation to which currently authenticated account is the owner or admin user.} diff --git a/man/ona_project_share.Rd b/man/ona_project_share.Rd index e8eb8fa..edba3ed 100644 --- a/man/ona_project_share.Rd +++ b/man/ona_project_share.Rd @@ -24,14 +24,14 @@ ona_project_share( a form with.} \item{role}{A character value for the role the user/s will have on the -project. This can be *readonly*, *dataentry*, *editor*, or *manager*.} +project. This can be \emph{readonly}, \emph{dataentry}, \emph{editor}, or \emph{manager}.} \item{email}{Email message to send to user/s to whom project has been shared with. If NULL (default), user/s will not be notified.} } \value{ Invisible. Project shared with specified users with specified - roles. A tibble of project information. +roles. A tibble of project information. } \description{ Share projects with user(s) diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 8a1b30e..765a2f3 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -18,7 +18,7 @@ navbar: type: light structure: left: [home, intro, reference, articles, news] - right: [search, mastodon, github] + right: [search, mastodon, linkedin, github] components: # articles: @@ -28,8 +28,12 @@ navbar: # href: articles/haemoglobinaemia.html mastodon: icon: "fab fa-mastodon fa-lg" - href: https://fosstodon.org/@katilingban aria-label: Mastodon + href: https://fosstodon.org/@katilingban + linkedin: + icon: "fab fa-linkedin fa-lg" + aria-label: LinkedIn + href: https://www.linkedin.com/company/katilingban home: links: