Skip to content

Commit e2d77f8

Browse files
committed
ci: export static html version of notebooks
1 parent 23fc598 commit e2d77f8

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/ExportPluto.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
name: Export Pluto notebooks
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-and-deploy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
18+
- name: Install Julia
19+
uses: julia-actions/setup-julia@v1
20+
with:
21+
version: 1.6
22+
23+
24+
# We set up a folder that Pluto can use to cache exported notebooks. If the notebook file did not change, then Pluto can take the exported file from cache instead of running the notebook.
25+
- name: Set up notebook state cache
26+
uses: actions/cache@v2
27+
with:
28+
path: pluto_state_cache
29+
key: ${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}-${{ hashFiles('**/*jl') }}
30+
restore-keys: |
31+
${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}
32+
33+
34+
- name: Run & export Pluto notebooks
35+
run: julia -e 'using Pkg;
36+
Pkg.activate(mktempdir());
37+
Pkg.add([
38+
Pkg.PackageSpec(name="PlutoSliderServer", version="0.2.1-0.2"),
39+
]);
40+
41+
import PlutoSliderServer;
42+
43+
PlutoSliderServer.github_action(;
44+
Export_cache_dir="pluto_state_cache",
45+
);'
46+
47+
48+
- name: Deploy to gh-pages
49+
uses: JamesIves/github-pages-deploy-action@releases/v3
50+
with:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
BRANCH: gh-pages
53+
FOLDER: .

0 commit comments

Comments
 (0)