Update actions #9
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 | |
jobs: | |
render-readme: | |
if: "contains(github.event.head_commit.message, 'render rmd')" | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: devtools | |
- name: Build package | |
run: | | |
devtools::install() | |
shell: Rscript {0} | |
- name: Render readme | |
run: | | |
rmarkdown::render("README.Rmd") | |
shell: Rscript {0} | |
- name: Commit README.md | |
run: | | |
git add README.md | |
git commit -m 'Re-build README.Rmd' || echo "Render README" | |
git push origin || echo "Render README" |