This repository has been archived by the owner on Dec 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
71 lines (65 loc) · 2.67 KB
/
ExportNotebooks.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Export Pluto notebooks & Deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
env:
JULIA_NUM_THREADS: 2
steps:
- name: Checkout master
uses: actions/checkout@v2
- name: Install Node
uses: actions/setup-node@v2
- run: npm install highlight.js
- name: Set up notebook state cache
uses: actions/cache@v2
with:
path: pluto_state_cache
key: ${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ hashFiles('**/*.jl') }}
restore-keys: |
${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Install Python # Needed for MLDatasets.jl
uses: actions/setup-python@v2
with:
python-version: '3.x' # Version range or exact version of a Python version to use
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install scipy
- name: Run Pluto notebooks
run: julia --color=yes --project=pluto-deployment-environment -e '
import Pkg;
Pkg.instantiate();
using PlutoSliderServer;
github_action("."; Export_cache_dir="pluto_state_cache");'
- name: Franklin
run: julia --color=yes -e '
using Pkg;
Pkg.add(["NodeJS", "JSON", "Franklin"]);
using NodeJS;
"== Run Franklin ==";
cd("website");
run(`$(npm_cmd()) install highlight.js`);
using Franklin;
optimize();
"== Place rendered notebooks in the website folder ==";
cp("../notebooks", "__site/notebooks");'
- name: Build and Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: website/__site
# To reduce state.
CLEAN: true
# To save space; we don't really need older versions.
SINGLE_COMMIT: true