Primary Resources
Previously
- Happy Git With R
- R Packages (2e)
- Rtools for R pkg developers (for windows)
- Xcode developer tools for R pkg developers (for macOS) –
sudo xcode-select --install
- pkgdown + GitHub Pages
- Quarto website reference
And now:
Part 3: Automating Quarto pkgdown
Publishing with GitHub Actions
In part 1 we:
In part 2, we:
Finally, in part 3, we will:
pkgdown
site when we update our R packageReminder: We are focusing on Github, not the intricacies or R code development, git, or other tools.
We may gloss over important R package details (debatable)
for the sake of the dopamine reward of automation doing our tedius work for us.
Reminder: Help each other, pair up, group up as needed.
sudo xcode-select --install
And now:
Using GitHub Actions
GitHub’s built-in automation system
and nearly identical to Microsoft's Azure Pipelines
‘Workflows’ as YAML
files
stored in .github/workflows/ folder in repo
Can be triggered by
pushes, PRs, schedules, manual runs, etc.
Let’s automate pkgdown::build_site()
on push!
usethis
Open your R package project (or you can use the Part 3 template). We’ll run:
YAML
file to your repogh-pages
branch instead of main
gh-pages
branch (not /docs
now)docs
folder. We don’t need it in our source repository anymore! Delete the docs folder.Let’s ensure each deployment is “clean”
Edit .github/workflows/pkgdown.yaml
:
If you don’t use clean: true
in the deploy action, it will add or update files, but not remove files that were deleted in your source. This can lead to lingering old content.
main
), and your site updates itselfpkgdown::build_site()
+ committing docs/
each time you want to update your website documentation for your packagepkgdown
allows us to quickly build an appealing interface for our pkg docsxcode-select --install