3
3
push :
4
4
branches :
5
5
- main
6
- concurrency :
7
- # Skip intermediate builds: always.
8
- # Cancel intermediate builds: only if it is a pull request build.
9
- group : ${{ github.workflow }}-${{ github.ref }}
10
- cancel-in-progress : ${{ startsWith(github.ref, 'refs/pull/') }}
11
6
jobs :
12
7
build-and-deploy :
13
8
runs-on : ubuntu-latest
14
- permissions :
15
- contents : write
16
9
steps :
17
- - name : Checkout
18
- uses : actions/checkout@v2
19
- with :
20
- persist-credentials : false
21
- # NOTE: Python is necessary for the pre-rendering (minification) step
22
- - name : Install python
23
- uses : actions/setup-python@v2
24
- with :
25
- python-version : ' 3.8'
26
- # NOTE: Here you can install dependencies such as matplotlib if you use
27
- # packages such as PyPlot.
28
- # - run: pip install matplotlib
29
- - name : Install Julia
30
- uses : julia-actions/setup-julia@v1
31
- with :
32
- version : ' 1' # Latest stable Julia release.
33
- # NOTE
34
- # The steps below ensure that NodeJS and Franklin are loaded then it
35
- # installs highlight.js which is needed for the prerendering step
36
- # (code highlighting + katex prerendering).
37
- # Then the environment is activated and instantiated to install all
38
- # Julia packages which may be required to successfully build your site.
39
- # The last line should be `optimize()` though you may want to give it
40
- # specific arguments, see the documentation or ?optimize in the REPL.
41
- - run : julia -e '
42
- using Pkg; Pkg.activate("."); Pkg.instantiate();
43
- using NodeJS; run(`$(npm_cmd()) install highlight.js`);
44
- using Franklin;
45
- optimize(clear=true)'
46
- - name : Build and Deploy
47
- uses : JamesIves/github-pages-deploy-action@releases/v3
48
- with :
49
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50
- BRANCH : gh-pages
51
- FOLDER : __site
10
+ - name : Git checkout
11
+ uses : actions/checkout@v3
12
+
13
+ - name : Cache
14
+ uses : actions/cache@v2
15
+ with :
16
+ path : |
17
+ __cache
18
+ ~/.julia
19
+ key : ${{ runner.os }}-franklin-cache-${{ github.sha }}
20
+ restore-keys : ${{ runner.os }}-franklin-cache-
21
+
22
+ # Julia
23
+ - name : Install Julia
24
+ uses : julia-actions/setup-julia@v1
25
+ with :
26
+ version : 1
27
+
28
+ # Website build
29
+ - run : julia -e '
30
+ using Pkg; Pkg.add(url="https://github.com/tlienart/Xranklin.jl", rev="main");
31
+ using Xranklin; build();'
32
+
33
+ # Deployment and caching
34
+ - run : touch __site/.nojekyll
35
+ - name : Deploy 🚀
36
+ uses : JamesIves/github-pages-deploy-action@releases/v4
37
+ with :
38
+ BRANCH : gh-pages
39
+ FOLDER : __site
0 commit comments