-
Notifications
You must be signed in to change notification settings - Fork 12
82 lines (64 loc) · 2.38 KB
/
render-readme-pkgdown.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: render readme and pkgdown
# 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
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@master
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
- name: Install XQuartz on macOS
if: runner.os == 'macOS'
run: brew install --cask xquartz
- name: Install harfbuzz on macOS
if: runner.os == 'macOS'
run: brew install harfbuzz
- name: Install fribidi on macOS
if: runner.os == 'macOS'
run: brew install fribidi
- name: Query dependencies
run: |
install.packages(c('remotes', 'devtools'))
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}
#- name: Cache R packages
# uses: actions/cache@v1
# with:
# path: ${{ env.R_LIBS_USER }}
# key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
# restore-keys: macOS-r-4.0-1-
- name: Install dependencies, create helpfiles
run: |
remotes::install_deps(dependencies = TRUE)
devtools::document()
shell: Rscript {0}
- name: commit newly made helpfiles
run: |
git add man/* || echo "No changes to commit"
git commit -m "Re-build docs" || echo "No changes to commit"
git push origin master || echo "No changes to commit"
- name: Install package
run: R CMD INSTALL .
# install packages needed
- name: install required packages
run: Rscript -e 'install.packages(c("rmarkdown", "knitr", "badger", "pkgdown"))'
# Render READEME.md using rmarkdown
- name: render README
run: Rscript -e 'rmarkdown::render("README.Rmd", output_format = "md_document")'
- name: commit rendered README
run: |
git config --global user.email "[email protected]"
git config --global user.name "Render action"
git add README.md
git commit -m "Re-build README.md" || echo "No changes to commit"
git push origin master || echo "No changes to commit"
- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}