GitHub actions for R
Provides GitHub actions and some R functions to create workflows.
GitHub actions for R
GitHub actions are a new workflow automation feature of the popular code repository host GitHub. The product is currently in limited beta. It may offer a better way to adopt continuous integration and delivery best practices in the R community. GitHub actions is a convenient service layer on top of the popular container standard docker, and is itself partly open source, thus limiting vendor lock-in. Most importantly, it is simple to reason about if things go wrong.
The ghactions project offers three avenues to bring GitHub actions to the
- Some actions to run R-specific jobs on GitHub, including arbitrary R code or deploying to shinyapps.io. These actions are maintained in this repository, but are not technically part of the accompanying ghactions R package. You can use these actions independently from the package; they are freely available on GitHub marketplace. In fact, the whole idea of GitHub actions is that people re-use such small building blocks any way they like.
- The accompanying ghactions R package furnishes you with some out-of-the-box workflows for different kinds of projects. These functions are styled after the popular usethis package. They don't do much: They just set you up with some configuration files for your project, using sensible defaults.
- Documenting experiences and evolving best practices for how to make the most of GitHub actions for R.
To install, run:
ghactions currently relies on a dev version of usethis, which should be automatically installed alongside it.
If you're using
devtools::install_github() or otherwise currently have usethis loaded, you may need to restart your the R session before ghactions can find the dev usethis (RStudio > Session > Restart R).
Because you're likely only to ever use it once, you need not take on ghactions as a dependency in your projects.
GitHub actions just requires a special file in a special directory at the root of your repository to work:
To quickly set up such a file for frequently used project kinds, run:
ghactions::use_ghactions(workflow = website())
See the documentation for implied defaults and alternatives.
Then push to GitHub and go to the actions tab in your repository. Enjoy.
Functions in ghactions
|auto_commit||Automatically commit changes|
|firebase||Create Google Firebase CLI action to use Firebase|
|ghactions_events||Supported events to trigger GitHub actions|
|edit_workflow||Open configuration files|
|docker_cli||Create Docker CLI action to run Docker|
|filter||Create filter action|
|ghactions||ghactions: GitHub actions for R|
|browse_github_actions||Quickly browse to important package webpages|
|rscript_byod||Create Rscript-byod action to run arbitrary R expressions|
|rsync||Create rsync action to deploy via Rsync over SSH|
|use_ghactions||Workflow automation with GitHub Actions|
|use_dockerfile||Set up a simple Dockerfile|
|ghpages||Create ghpages action to deploy to GitHub Pages|
|make_blocks||Create GitHub Actions syntax blocks|
|netlify||Create netlify cli action to use the Netlify CLI|
|website||Render and deploy a website|
Vignettes of ghactions
|License||MIT + file LICENSE|
|Roxygen||list(markdown = TRUE)|
|imports||checkmate (>= 1.8.1) , desc (>= 1.2.0) , fs (>= 1.2.6) , gh (>= 1.0.1) , glue (>= 1.3.0) , pkgload (>= 1.0.2) , purrr (>= 0.3.0) , readr (>= 1.3.1) , rlang (>= 0.3.1) , usethis (>= 1.5.0) , whisker (>= 0.3-2)|
|suggests||devtools (>= 2.0.2) , docopt (>= 0.6.1) , knitr (>= 1.23) , processx (>= 3.3.1) , rmarkdown (>= 1.13) , roxygen2 (>= 6.1.0) , testthat (>= 2.1.0) , withr (>= 2.1.2)|
|depends||R (>= 3.5.0)|
|Contributors||Jim Hester, Verena Held, RStudio Inc.|
Include our badge in your README