Skip to content

Commit f9238b5

Browse files
committed
build pkgdown home file before rendering pkgdown
1 parent 37dc3ef commit f9238b5

File tree

4 files changed

+12
-725
lines changed

4 files changed

+12
-725
lines changed

.Rbuildignore

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
^LICENSE\.md$
66
^README\.Rmd$
77
^README\.html$
8+
^index\.Rmd$
9+
^index\.md$
10+
^index\.html$
811
^\.github$
912
^cran-comments\.md$
1013
^CRAN-SUBMISSION$

.github/workflows/pkgdown.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
local::.
5050
needs: website
5151

52+
- name: Render Rmarkdown files and Commit Results
53+
run: |
54+
RMD_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '[.]Rmd$'))
55+
Rscript -e 'for (f in commandArgs(TRUE)) if (file.exists(f)) rmarkdown::render(f)' ${RMD_PATH[*]}
56+
git config --local user.name "$GITHUB_ACTOR"
57+
git config --local user.email "[email protected]"
58+
git commit ${RMD_PATH[*]/.Rmd/.md} -m 'Re-build Rmarkdown files' || echo "No changes to commit"
59+
git push origin || echo "No changes to commit"
60+
5261
- name: Build site
5362
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
5463
shell: Rscript {0}

0 commit comments

Comments
 (0)