-
-
Notifications
You must be signed in to change notification settings - Fork 133
89 lines (77 loc) · 2.99 KB
/
publish.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: publish
run-name: Build and publish book
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout current branch
uses: actions/checkout@v3
- name: Download Java
uses: typelevel/download-java@v1
id: download-java
with:
distribution: 'temurin'
java-version: 17
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'jdkfile'
java-version: 17
jdkFile: ${{ steps.download-java.outputs.jdkFile }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'latest'
cache: 'npm'
- run: npm ci
# - name: Install TeX Live
# uses: zauguin/install-texlive@v2
# with:
# packages: >
# l3build latex latex-bin luatex latex-bin-dev xetex mdframed amsmath listings xcolor fancyvrb kvoptions etoolbox booktabs hyperref zref infwarerr pdftexcmds iftex needspace
# MikTex automatically installs the latex packages that are needed by the document
- name: Setup MikTex
run: |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D6BC243565B2087BC3F897C9277A7293F59E4889
echo "deb http://miktex.org/download/ubuntu jammy universe" | sudo tee /etc/apt/sources.list.d/miktex.list
sudo apt-get update
sudo apt-get install miktex
sudo miktexsetup --shared=yes finish
sudo initexmf --admin --set-config-value [MPM]AutoInstall=yes
- name: Setup Pandoc
run: |
curl -Ls https://github.com/jgm/pandoc/releases/download/3.1.2/pandoc-3.1.2-linux-amd64.tar.gz > /tmp/pandoc.tgz
tar zxvf /tmp/pandoc.tgz
mv pandoc-3.1.2/bin/pandoc /usr/local/bin/pandoc
curl -Ls https://github.com/lierdakil/pandoc-crossref/releases/download/v0.3.16.0/pandoc-crossref-Linux.tar.xz > /tmp/pandoc-crossref.tgz
tar xvf /tmp/pandoc-crossref.tgz
mv pandoc-crossref /usr/local/bin/pandoc-crossref
- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache/v1
~/.cache/coursier/v1
~/AppData/Local/Coursier/Cache/v1
~/Library/Caches/Coursier/v1
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Install Fonts
run: |
sudo apt-get update -y
sudo apt-get install -y ttf-bitstream-vera
- name: Generate book
run: sbt all
- name: Copy book to site
run: |
mkdir site/dist
mv dist/* site/dist
- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/develop'
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site
keep_files: true