This repository has been archived by the owner on Nov 8, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 29
68 lines (62 loc) · 2.3 KB
/
Build.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
name: Build
on:
pull_request:
branches:
- main
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
# Required by julia-actions/cache.
actions: write
# For the comment in the PRs saying that the PDF is ready.
pull-requests: write
env:
JULIA_NUM_THREADS: "auto"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Node
uses: actions/setup-node@v4
- run: npm install highlight.js
- name: Install Julia
uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v2
# NOTE
# The steps below ensure that NodeJS and Franklin are loaded then it
# installs highlight.js which is needed for the prerendering step
# (code highlighting + katex prerendering).
# Then the environment is activated and instantiated to install all
# Julia packages which may be required to successfully build your site.
# The last line should be `optimize()` though you may want to give it
# specific arguments, see the documentation or ?optimize in the REPL.
- run: julia --color=yes -e '
using Pkg;
Pkg.activate("."); Pkg.instantiate();
using NodeJS; run(`$(npm_cmd()) install highlight.js`);
using Franklin;
optimize(); verify_links();' > build.log
env:
# Allows the use of unicode characters in Plots.jl
GKS_ENCODING: "utf8"
# Fixes 'GKS: can't connect to GKS socket application' errors
# and quality of output plots in GR back end.
GKSwstype: "100"
- name: Make Franklin preview available
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
with:
name: preview
path: ./__site
- name: Create a comment to say that the artifact is ready
if: ${{ github.event_name == 'pull_request' }}
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.number }}
body: |
The site preview was created and uploaded as an artifact.
You can find it on the GitHub Actions Summary page for the GitHub Actions Runs in this PR.