Skip to content

Merge pull request #193 from avehtari/qmd_migration #92

Merge pull request #193 from avehtari/qmd_migration

Merge pull request #193 from avehtari/qmd_migration #92

Workflow file for this run

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 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: .