-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (55 loc) · 1.81 KB
/
deploy.yml
File metadata and controls
68 lines (55 loc) · 1.81 KB
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: GitHub Pages
on:
push:
branches:
- master
pull_request:
jobs:
gh-pages:
# Puppeteer (used by pagedjs) has issues with Ubuntu 23.04+
# https://github.com/puppeteer/puppeteer/issues/12818
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Cache Nodejs downloads
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package.json', 'package-lock.json') }}
- name: Cache LuaRocks modules
uses: actions/cache@v4
with:
path: lua_modules
key: lua-modules-${{ hashFiles('polytype-dev-1.rockspec', 'polytype-dev-1.rockslock') }}
- name: Cache Typst packages
uses: actions/cache@v4
with:
path: ~/.cache/typst
key: typst-packages-${{ hashFiles('~/.cache/typst/**/typst.toml') }}
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v21
- name: Cache Nix builds
uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Install Nix package dependencies
run: |
nix-channel --update
nix-shell --run true
- name: Install Node module dependencies
run: |
nix-shell --run 'npm ci'
- name: Generate static site pages
run: |
nix-shell --pure --run 'make public'
- name: Inject CNAME
if: ${{ github.repository == 'alerque/polytype' }}
run: |
nix-shell --pure --run 'make public/CNAME'
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true