-
Notifications
You must be signed in to change notification settings - Fork 559
55 lines (52 loc) · 2.22 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
on:
push:
branches:
- master
# paths: ['**.Rmd']
name: render-rmarkdown
jobs:
render-rmarkdown:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
with:
fetch-depth: 0
env:
GITHUB_PAT: ${{ secrets.GH_ACTION }}
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
image: meenaljhajharia/bda-docker:latest
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
cd /work
git config --global --add safe.directory /work
git config --global user.name "avehtari"
git config --global user.email "[email protected]"
git checkout master
rmdfiles=$(git diff --name-only HEAD^ | grep '[.]*Rmd$')
# qmdfiles=$(git diff --name-only HEAD^ | grep '[.]*qmd$')
if [ -n "${rmdfiles}" ]; then while read -r filename; do echo "$filename"; Rscript -e "rmarkdown::render('$filename')"; done <<< "$rmdfiles"; fi
# if [ -n "${qmdfiles}" ]; then while read -r filename; do echo "$filename"; quarto render $filename; done <<< "$qmdfiles"; fi
diff_assignments=$(git diff --name-only HEAD^ | grep '^assignments/')
if [ -n "${diff_assignments}" ]; then
echo "Rendering assignments using quarto"
cd assignments
zip -r templates.zip template*.qmd additional_files
quarto install tinytex > /dev/null
# quarto render .
# cd ..
cd ..
quarto render assignments
# quarto publish gh-pages assignments --no-browser
fi
- name: GitHub Pages action
uses: peaceiris/[email protected]
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GH_ACTION}}
publish_branch: gh-pages
keep_files: true
publish_dir: .