-
-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (55 loc) · 1.74 KB
/
deploy.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
name: GitHub Pages
on:
push:
branches:
- master
pull_request:
jobs:
gh-pages:
runs-on: ubuntu-20.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache example fonts
uses: actions/cache@v2
with:
path: |
.fonts
.sources
key: fonts-${{ hashFiles('Makefile-fonts') }}
- name: Cache example artifacts
uses: actions/cache@v2
with:
path: |
static/examples
key: examples-${{ hashFiles('Makefile', 'data/examples.toml', 'content/examples/*.sil', 'content/examples/*.xml', 'content/examples/*.lua') }}
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Install project dependencies
run: |
nix-channel --update
nix-shell --run true
nix-shell --run 'sile --version'
nix run github:sile-typesetter/sile#sile -- --version
- name: Generate example artifacts
run: |
nix-shell --run 'make examples'
- name: Generate static site pages
run: |
nix-shell --run 'make public'
- name: Inject CNAME
if: ${{ github.repository == 'sile-typesetter/sile-typesetter.github.io' }}
run: |
nix-shell --run 'make public/CNAME'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force_orphan: true