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 #rstats
community:
To install, run:
remotes::install_github("r-lib/ghactions")
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: .github/main.workflow
.
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.