-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 2.21 KB
/
generate.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
name: Generate website
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: generate
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Julia
uses: julia-actions/setup-julia@v2
with:
version: "1.10"
# 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: ⏱ Cache notebook states
uses: actions/cache@v4
with:
path: _cache
key: ${{ runner.os }}-pluto_state_cache-v3-fall22-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-pluto_state_cache-v3-fall22-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
- name: ⏱ Cache .julia
uses: actions/cache@v4
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: 🪴 Generate site
run: |
julia --project=pluto-deployment-environment -e '
import Pkg
Pkg.instantiate()
import PlutoPages
PlutoPages.generate("."; html_report_path="generation_report.html")
cp("./netlify.toml", "./_site/netlify.toml")'
- uses: actions/upload-artifact@v4
if: always()
with:
path: generation_report.html
- name: 🚀 Deploy to dist
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: dist
folder: _site