diff --git a/.github/workflows/render-README.yaml b/.github/workflows/render-README.yaml new file mode 100644 index 0000000..33d64c9 --- /dev/null +++ b/.github/workflows/render-README.yaml @@ -0,0 +1,39 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + paths: ['README.Rmd'] + workflow_dispatch: + paths: ['README.Rmd'] + + +name: Render README + +jobs: + render-rmarkdown: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + + - uses: r-lib/actions/setup-renv@v2 + + - name: Render README.Rmd + run: | + Rscript -e 'rmarkdown::render("README.Rmd")' + + - name: Commit results + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add README.md + git commit -m 'Re-build README.Rmd' || echo "No changes to commit" + git push origin || echo "No changes to commit" diff --git a/README.Rmd b/README.Rmd index 1d2099b..a8c051e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -50,7 +50,7 @@ glue::glue('