-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.87 KB
/
dashboard.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
# completed could be success or failure
# Additional job checks determine the behavior, see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow
on:
workflow_run:
workflows: [score]
types:
- completed
workflow_dispatch:
name: render-rmarkdown
jobs:
render-rmarkdown:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
container: rocker/geospatial
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
# - uses: r-lib/actions/setup-renv@v1
- name: Install
run: |
Rscript -e "install.packages('remotes')"
Rscript -e "install.packages('DT')"
Rscript -e "install.packages('reticulate')"
Rscript -e "remotes::install_deps()"
- name: Render
shell: Rscript {0}
run: |-
rmarkdown::render("html/home.Rmd", envir = globalenv())
rmarkdown::render("html/fishing.Rmd", envir = globalenv())
rmarkdown::render("html/climate.Rmd", envir = globalenv())
rmarkdown::render("html/epidemic.Rmd", envir = globalenv())
rmarkdown::render("html/conservation.Rmd", envir = globalenv())
rmarkdown::render("html/wildfire.Rmd", envir = globalenv())
rmarkdown::render("html/errors.Rmd", envir = globalenv())
- name: Commit results
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add html/*.html
git commit -m 'Re-build Rmarkdown files' || echo "No changes to commit"
git push origin || echo "No changes to commit"