![]() The name of this process is “Render README”. The jobs run every time there’s a push on the master branch ![]() The first two parts are quite self-explanatory: On : push : branches : master name : Render README jobs : render : name : Render README runs-on : macOS-latest steps : - uses : - uses : - uses : - name : Install rmarkdown run : Rscript -e 'install.packages("rmarkdown")' - name : Render README run : Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")' - name : Commit results run : | git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit" git push origin || echo "No changes to commit" yml file that contains the R code you want to run to render the README. This is where GitHub Actions comes into play. Without GitHub Actions, in addition to modify the CSV file, I would have to clone the repo, open it in RStudio, render the README, and push it back on GitHub.īut this task is repetitive: apart from the details I add to the CSV file, it can be automated. The problem is that this CSV file is then used into an R Markdown file, that creates a clean README with all the information. The idea is that when I (or someone else) find a JavaScript library that has been adapted into an R package, I add it to a CSV file on GitHub. I wanted this list to be easy to update, so that it can be done on GitHub directly. One of my GitHub repos is a list of JavaScript libraries that have been adapted in R. ![]() In this post, I will present you two cases in which I use GitHub Actions to automatically do that. Sometimes, it is useful to automatically render an R Markdown document or a website, made with distill for example.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |