-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.58 KB
/
render-readme.yaml
File metadata and controls
53 lines (45 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Modified from
# - https://github.com/r-lib/actions/tree/master/examples#render-rmarkdown
# - https://github.com/gavinsimpson/gratia/blob/master/.github/workflows/readme-renderer.yaml
on:
workflow_dispatch:
push:
branches:
- main
- master
name: Render Readme
jobs:
render:
name: Render Readme
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- 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: |
local::.
any::devtools
any::kableExtra
any::RCurl
github::aravind-j/EvaluateCore?reinstall
- name: Render README.md using rmarkdown
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "github_document")'
- name: Commit rendered README
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add README.md README.html
git commit -m "Re-build README.md" || echo "No changes to commit"
git push origin master || echo "No changes to commit"
- name: Trigger pkgdown workflow
if: success()
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: ${{ github.repository }}
event-type: trigger-pkgdown-workflow
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'