-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·38 lines (31 loc) · 1.25 KB
/
render-readme.yaml
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
# For help visit following page:
# https://fromthebottomoftheheap.net/2020/04/30/rendering-your-readme-with-github-actions/
name: render readme
# Controls when the action will run
on:
push:
branches: master
jobs:
render:
# The type of runner that the job will run on
runs-on: macOS-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
# Install packages needed
- name: install required packages
run: Rscript -e 'install.packages(c("devtools", "knitr", "rmarkdown"), dependencies = TRUE)'
# Install packages needed from GitHub
- name: install from GitHub
run: Rscript -e 'remotes::install_github("kamapu/yamlme", dependencies = TRUE)'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Render README.md using rmarkdown
- name: render README
run: Rscript -e 'rmarkdown::render("README.Rmd")'
- name: commit rendered README
run: |
git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit"
git push origin || echo "No changes to commit"