-
Notifications
You must be signed in to change notification settings - Fork 18
61 lines (50 loc) · 1.95 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
53
54
55
56
57
58
59
60
61
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
schedule:
# Runs every Sunday at midnight UTC
- cron: 0 0 * * 0
name: render-rmarkdown
jobs:
render-rmarkdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-renv@v1
- name: Install macOS dependencies
run: |
brew install xquartz --cask
# conflicts with gfortran from r-lib/actions when linking gcc
rm '/usr/local/bin/gfortran'
brew install gdal proj geos
brew install imagemagick ghostscript
brew tap coin-or-tools/coinor
brew install symphony
Rscript -e "install.packages('R2OpenBUGS',type='source')"
- name: Install R dependencies
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
install.packages(c("remotes", "rmarkdown", "httr"), repos = "https://cloud.r-project.org/")
remotes::install_github("ggseg/ggsegExtra")
shell: Rscript {0}
- name: Install ggsegExtra
run: R CMD build ggsegExtra
- name: Render Rmarkdown files
run: rmarkdown::render("README.Rmd", output_format = "github_document")
shell: Rscript {0}
- name: Commit results
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
git commit ${RMD_PATH[*]/.Rmd/.md} -m 'Re-build Rmarkdown files' || echo "No changes to commit"
git push origin || echo "No changes to commit"