-
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (60 loc) · 1.91 KB
/
Copy pathdeploy.yml
File metadata and controls
73 lines (60 loc) · 1.91 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
69
70
71
72
73
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@v7
with:
fetch-depth: 0
- name: Cache Nodejs downloads
uses: actions/cache@v5
with:
path: node_modules
key: node-modules-${{ hashFiles('package.json', 'package-lock.json') }}
- name: Cache LuaRocks modules
uses: actions/cache@v5
with:
path: lua_modules
key: lua-modules-${{ hashFiles('polytype-dev-1.rockspec', 'polytype-dev-1.rockslock') }}
- name: Cache Typst packages
uses: actions/cache@v5
with:
path: ~/.cache/typst
key: typst-packages-${{ hashFiles('~/.cache/typst/**/typst.toml') }}
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Cache Nix builds
uses: cachix/cachix-action@v17
with:
name: polytype
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- 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