ClevelandClinicQHS / riskcalc

An R package for building risk calculators
https://clevelandclinicqhs.github.io/riskcalc/
Other
2 stars 0 forks source link

Setup package website with pkgdown #4

Closed zajichek closed 1 year ago

zajichek commented 1 year ago

Following https://r-pkgs.org/website.html

zajichek commented 1 year ago

Ran the following to setup site

usethis::use_pkgdown()
pkgdown::build_site()

Updated DESCRIPTION so we see QHS on site:

Authors@R: c(
    person("Alex", "Zajichek", , "zajicha2@ccf.org", role = c("aut", "cre"),
           comment = c(ORCID = "0000-0001-9591-6692")),
    person("Cleveland Clinic Quantitative Health Sciences", role = c("cph", "fnd")))

image

zajichek commented 1 year ago

Called usethis::use_pkgdown_github_pages() to set up the deployment workflow

As we can see in Settings, this function activated/configured Pages to point to the gh-pages branch https://github.com/ClevelandClinicQHS/riskcalc/tree/gh-pages, and set the URL (among other things)

image

zajichek commented 1 year ago

Getting this error message trying to push the changes made that set up the workflow

! [remote rejected] HEAD -> main (refusing to allow a Personal Access Token to create or update workflow .github/workflows/pkgdown.yaml without workflow scope)`

Tried changing settings in the Organizations around Actions, but didn't help.

Found this useful: https://github.com/orgs/community/discussions/26254

Had to create a new PAT, and check the workflows option. Then had

Also, make sure to run use_pkgdown_github_pages() after you've pushed the initial files for pkgdown. The remote repo had nothing it so I ran it again and now the site is live here: https://clevelandclinicqhs.github.io/riskcalc/

zajichek commented 1 year ago

It takes a minute or so, but from the main branch you can see the deployment progress happening. image

We can see the subsequent changes now deployed on the website: https://clevelandclinicqhs.github.io/riskcalc/ (again, I didn't build the website manually, I just changed the README files then pushed to main. The Action then took those changes, built the site, and deployed automatically). Workflow should be set.