Skip to content

render-deploy

render-deploy #116

name: Render to HTML & Deploy
on:
repository_dispatch:
types: [render-deploy]
jobs:
check-changes:
name: Check if Rmd or image files changed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Find directories with changed rmd or image files
id: changed-files-dir-names
uses: tj-actions/changed-files@v41
with:
files: |
src/G*/*.{rmd,Rmd}
src/G*/img/*.{png,gif}
src/G*/img/*/*.{png,gif}
dir_names: "true"
dir_names_max_depth: 2
- name: Render modified courses to HTML and move output to docs
run: |
folder_list="${{ steps.changed-files-dir-names.outputs.all_changed_files }}"
IFS=" "
read -ra folders <<< "$folder_list"
export WORKFLOW=true
for folder in "${folders[@]}"; do
code="${folder#src/}"
./render.sh $code
done
- name: Add, Commit & Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -B pages
git add docs/G*
git commit -m "Automatic: Render docs from ${GITHUB_SHA}"
git push --force origin pages
# - name: Add, Commit & Push
# uses: EndBug/add-and-commit@v7
# with:
# add: "docs/G*"
# message: "Automatic: Update docs"