Skip to content

re-run notebooks

re-run notebooks #786

Workflow file for this run

name: Publish school-specific branches / site versions
on: push
# cancel any previous builds
concurrency:
group: schools-${{ github.ref }}
cancel-in-progress: true
jobs:
schools:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
school:
- columbia
- nyu
# https://github.com/mamba-org/provision-with-micromamba#important
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/setup
# avoid force pushes on school branches by merging main but then only committing the processed files
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Switch to school branch
run: git switch ${{ matrix.school }}
- name: Merge from base branch
run: git merge -s ours --no-commit --no-ff ${{github.ref_name}}
- name: Restore files from base branch
# https://stackoverflow.com/a/68636946/358804
run: git restore --source ${{github.ref_name}} --worktree --staged -- .
- name: Commit preliminary changes
run: |
git add -A
git commit -m "CI: render for school"
- name: Render for school
run: ./extras/scripts/school_ci.sh ${{ matrix.school }}
- name: Update commit
run: |
git add -A
git commit --amend --no-edit
- name: Push branch
run: git push origin ${{ matrix.school }}
if: github.ref_name == 'main'
- name: Store rendered HTML for link checking
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.school }}
path: _build/html
# do this as a separate job from link checking so that broken external links don't block the site build
check_links:
runs-on: ubuntu-latest
needs: schools
strategy:
fail-fast: false
matrix:
school:
- columbia
- nyu
steps:
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3"
- name: Install dependencies
run: gem install html-proofer
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: ${{ matrix.school }}
path: _build/html
- name: Check for broken links
run: ruby extras/scripts/broken_links.rb