-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (44 loc) · 1.49 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
on:
push:
paths:
- 'README.Rmd'
workflow_dispatch:
name: Render README
jobs:
render:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.
- name: Render README.Rmd
run: Rscript -e 'rmarkdown::render("README.Rmd")'
- name: Commit and create a Pull Request on production
if: ${{ github.ref == 'refs/heads/production' }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Render `README.md` after changes to the `.Rmd` version"
branch: render_readme
delete-branch: true
title: "Render `README.md` after changes to the `.Rmd` version"
labels: documentation,Maintainance
assignees: ${{ github.actor }}
reviewers: ${{ github.actor }}
- name: Commit and push changes on all other branches
if: ${{ github.ref != 'refs/heads/production' }}
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Render `README.md` after changes to the `.Rmd` version"