From 774798175d9b845c548eefc8eb673dc3ea88c228 Mon Sep 17 00:00:00 2001 From: James McMahon Date: Thu, 29 Jul 2021 08:32:59 +0100 Subject: [PATCH] Add GitHub action to re-knit README.rmd whenever changes are pushed to it. --- .github/workflows/render-README.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/render-README.yml diff --git a/.github/workflows/render-README.yml b/.github/workflows/render-README.yml new file mode 100644 index 0000000..d43fb10 --- /dev/null +++ b/.github/workflows/render-README.yml @@ -0,0 +1,23 @@ +on: + push: + paths: + - 'README.Rmd' + +jobs: + render: + name: Render README + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-pandoc@v1 + - 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 -m 'Re-build README.Rmd' || echo "No changes to commit" + git push origin || echo "No changes to commit"