File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -31,19 +31,16 @@ jobs:
3131 with :
3232 use-public-rspm : true
3333
34- - uses : r-lib/actions/setup-r-dependencies@v2
35- with :
36- extra-packages : |
37- any::rmarkdown
38- any::knitr
34+ - uses : r-lib/actions/setup-renv@v2
3935
4036 - name : Render RMarkdown site
4137 run : Rscript -e 'rmarkdown::render_site("rmd")'
4238
43- - name : Deploy to GitHub pages 🚀
44- if : github.event_name != 'pull_request'
45- uses : JamesIves/github-pages-deploy-action@v4.5.0
46- with :
47- clean : false
48- branch : gh-pages
49- folder : docs
39+ - name : Render Rmarkdown files and Commit Results
40+ run : |
41+ RMD_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '[.]Rmd$'))
42+ Rscript -e 'for (f in commandArgs(TRUE)) if (file.exists(f)) rmarkdown::render(f)' ${RMD_PATH[*]}
43+ git config --local user.name "$GITHUB_ACTOR"
44+ git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
45+ git commit ${RMD_PATH[*]/.Rmd/.md} -m 'Re-build Rmarkdown files' || echo "No changes to commit"
46+ git push origin || echo "No changes to commit"
You can’t perform that action at this time.
0 commit comments