-
Notifications
You must be signed in to change notification settings - Fork 10
71 lines (57 loc) · 2.73 KB
/
Export.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
###
# HELLO
# Interested in setting up a cool github action like this one? Take a look at: https://github.com/JuliaPluto/static-export-template
name: Export Pluto notebooks
on:
push:
branches:
- main
workflow_dispatch:
# When two jobs run in parallel, cancel the older ones, to make sure that the website is generated from the most recent commit.
concurrency:
group: pluto-export
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
# note: this version should match the version in the other actions in this repo
version: "1.6"
- name: Cache Julia artifacts & such
uses: julia-actions/cache@v1
with:
cache-registries: "true"
# 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.
- name: Set up notebook state cache
uses: actions/cache@v3
with:
path: pluto_state_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: install GL dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils
- name: Run & export Pluto notebooks
run: |
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia -e '
import Pkg
Pkg.activate("pluto-deployment-environment")
Pkg.instantiate()
import PlutoSliderServer
isdir("output") && rm("output"; recursive=true)
PlutoSliderServer.github_action("src";
Export_output_dir="output",
Export_cache_dir="pluto_state_cache",
# more parameters can go here
)
cp("netlify.toml", joinpath("output", "netlify.toml"))'
- name: Deploy to dist
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: dist
folder: output