-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (57 loc) · 2.05 KB
/
pr_build.yml
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
54
55
56
57
58
59
name: pr_build
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Install dependencies
run: |
install.packages(c('rmarkdown', 'styler','usethis', 'devtools', 'pkgdown', 'rcmdcheck', 'remotes'))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Configure git
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub"
- name: Check
run: |
Rscript -e 'devtools::check()'
git add man/ NAMESPACE
git commit \
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" \
-m '📚 Render Roxygen documentation' || echo "No changes to commit"
- name: Style
run: |
Rscript -e 'usethis::use_tidy_style()'
git add .
git commit \
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" \
-m '🎨 Style R code' || echo "No changes to commit"
- name: Render README
run: |
Rscript -e 'devtools::build_readme()'
git add README.md
git commit \
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" \
-m '📄 Render README.Rmd' || echo "No changes to commit"
- name: Docs
run: |
Rscript -e "pkgdown::build_reference(); devtools::build_site()"
git add docs
git commit \
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" \
-m "📑 Build docs site" || echo "No changes to commit"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}