-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (61 loc) · 2.08 KB
/
render-module-rmd.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
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
paths:
- .github/workflows/render-module-rmd.yaml
- Biomass_core.Rmd
- Biomass_core.R
name: Render module Rmd
jobs:
render:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
name: Render module Rmd
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
Ncpus: 2
- name: Install additional system dependencies
run: |
sudo apt-get install -y \
libcurl4-openssl-dev \
libgdal-dev \
libgeos-dev \
libgit2-dev \
libglpk-dev \
libmagick++-dev \
libproj-dev \
libudunits2-dev \
libxml2-dev \
python3-gdal
- uses: PredictiveEcology/actions/install-Require@v0
with:
GitTag: '5c44205bf407f613f53546be652a438ef1248147'
- uses: PredictiveEcology/actions/install-SpaDES@v0
- uses: PredictiveEcology/actions/install-Rmd-pkgs@v0
- name: Install additional packages
run: |
options(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/focal/latest", CRAN = "https://cran.rstudio.com"))
Require::Require(c("PredictiveEcology/LandR@development"), require = FALSE)
shell: Rscript {0}
- name: Render module Rmd
run: |
rmarkdown::render("Biomass_core.Rmd", encoding = "UTF-8")
shell: Rscript {0}
- name: Commit results
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
git commit Biomass_core.html -m 'Re-build Biomass_core.Rmd' || echo "No changes to commit"
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{github.ref}} || echo "No changes to commit"