-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.49 KB
/
render.yml
File metadata and controls
55 lines (46 loc) · 1.49 KB
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
name: Render Rmd and update Pages HTML
on:
push:
branches: [ main ]
paths:
- '**.Rmd'
- '.github/workflows/render.yml'
workflow_dispatch:
permissions:
contents: write
jobs:
render:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # get full history so rebase works
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install system requirements & R packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rmarkdown
any::sf
any::sp
any::spdep
any::ggplot2
any::gstat
- name: Knit variogram_tutorial1.rmd to index.html
run: |
Rscript -e "rmarkdown::render('variogram_tutorial1.rmd', output_format='html_document', output_file='index.html')"
- name: Commit HTML (if changed)
run: |
git config user.name "github-actions"
git config user.email "actions@github.com"
git add index.html
git commit -m "CI: render index.html" || echo "No changes to commit"
- name: Rebase onto latest main and push
run: |
git fetch origin
git rebase origin/main || { echo "Rebase failed, aborting & falling back to merge"; git rebase --abort; git pull --no-rebase --no-edit origin main; }
git push origin HEAD:main