render readme #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
name: render-readme | ||
permissions: read-all | ||
jobs: | ||
render-rmarkdown: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: r-lib/actions/setup-r@v2 | ||
- uses: r-lib/actions/setup-pandoc@v2 | ||
# install packages | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rmarkdown | ||
# Render README.md using rmarkdown | ||
- name: render README | ||
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")' | ||
- name: commit rendered README | ||
run: | | ||
git add README.md man/figures/README-* | ||
git commit -m "Re-build README.md" || echo "No changes to commit" | ||
git push origin master || echo "No changes to commit" |