Merge pull request #142 from alhirzel/patch-1 #431
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fall 23 - Export Pluto notebooks & Deploy | |
on: | |
push: | |
branches: | |
- Fall23 | |
workflow_dispatch: | |
concurrency: | |
group: export | |
cancel-in-progress: true | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Fall 23 source | |
uses: actions/checkout@v2 | |
- name: 🙌 Install Julia | |
uses: julia-actions/setup-julia@v1 | |
with: | |
version: "1.8" | |
- name: ⏱ Cache notebook states | |
uses: actions/cache@v2 | |
with: | |
path: _cache | |
key: ${{ runner.os }}-pluto_state_cache-v3-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-pluto_state_cache-v3-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} | |
- name: ⏱ Cache .julia | |
uses: actions/cache@v2 | |
with: | |
path: ~/.julia | |
key: ${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-dotjulia-v1-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} | |
- name: 📅 Checkout Fall20, Spring21, Fall22 output | |
uses: actions/checkout@v2 | |
with: | |
path: Fall22-output | |
ref: Fall22-output | |
- name: 🪴 Generate site | |
run: julia --project=pluto-deployment-environment -e ' | |
import Pkg; | |
Pkg.instantiate(); | |
include("./generate.jl")' | |
- name: 📰 Upload site generation report | |
uses: actions/upload-artifact@v2 | |
if: always() | |
with: | |
path: generation_report.html | |
- name: 🔀 Combine semesters into single site | |
run: | | |
mkdir www | |
mv Fall22-output/Fall20/ www/Fall20 | |
mv Fall22-output/Spring21/ www/Spring21 | |
mv Fall22-output/Fall22/ www/Fall22 | |
mv _site www/Fall23 | |
mv extra_outputs/* www | |
- name: 🚀 Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: Fall23-output | |
FOLDER: www |