-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (71 loc) · 2.23 KB
/
render.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
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
83
84
85
86
87
88
89
90
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: Render Rmd
on:
push:
branches: [ "main" ]
pull_request:
defaults:
run:
shell: bash -l {0}
jobs:
jupyter-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] #, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: true
environment-name: qmn
environment-file: environment.yml
- name: Execute and export
run: |
jupytext --to notebook modules/**/*.py
jupyter nbconvert --NbConvertApp.recursive_glob=True --output-dir=modules/jupyter --execute --to html modules/**/*.ipynb
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: modules/jupyter/
Rmd-build:
needs: jupyter-build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] #, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Set up Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
- name: Cache Reference
uses: actions/cache@v3
with:
path: modules/module_3/data/reference
key: constant
# - uses: mxschmitt/action-tmate@v3
# - name: Render
# run: Rscript render.R
- name: Download jupyter artifacts
uses: actions/download-artifact@v3
with:
path: modules/jupyter/
- name: Generate index
if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main'
run: Rscript genIndex.R
- name: Deploy
if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: .