-
Notifications
You must be signed in to change notification settings - Fork 2
84 lines (70 loc) · 3.12 KB
/
ExportPluto.yaml
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
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Export Pluto notebooks
on:
push:
branches:
- main
- master
- export
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: false
# This action needs permission to write the exported HTML file to the gh-pages branch.
permissions:
actions: write
contents: read
pages: write
id-token: write
# (all other permission fields default to "none")
jobs:
build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
JULIA_DEPOT_PATH: /scratch/github-actions/julia_depot
runs-on: self-hosted
steps:
- name: Checkout this repository
uses: actions/checkout@v3
#- name: Install GLMakie 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: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: "1" # This will automatically pick the latest Julia version
- 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-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}-${{ hashFiles('**/*jl') }}
restore-keys: |
${{ runner.os }}-pluto_state_cache-v2-${{ hashFiles('**/Project.toml', '**/Manifest.toml', '.github/workflows/*' ) }}
- name: Run & export Pluto notebooks
run: |
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia -e 'using Pkg
Pkg.activate(mktempdir())
Pkg.add([
Pkg.PackageSpec(name="PlutoSliderServer", version="0.3.2-0.3"),
])
import PlutoSliderServer
PlutoSliderServer.github_action(".";
Export_cache_dir="pluto_state_cache",
Export_baked_notebookfile=false,
Export_baked_state=false,
Export_create_pluto_featured_index=true,
# more parameters can go here
)'
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy GitHub Pages site
id: deployment
uses: actions/deploy-pages@v4