-
Notifications
You must be signed in to change notification settings - Fork 89
69 lines (69 loc) · 1.84 KB
/
nix.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
name: Nix
on:
push:
branches:
- main
- staging
- trying
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
matrix:
os: [ ubuntu-20.04, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
with:
name: numtide
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
export PRJ_ROOT=$PWD
$(./shell.nix)/entrypoint --pure bash -c "echo OK"
- run: nix-shell --run "echo OK"
- run: nix-build
flakes:
strategy:
matrix:
os: [ ubuntu-20.04 ] # macos-latest is not working right now
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
# Nix Flakes doesn't work on shallow clones
fetch-depth: 0
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
with:
name: numtide
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix flake check
- run: nix develop -c echo OK
- name: Run nix flake archive
run: nix flake archive
docs:
strategy:
matrix:
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
- uses: cachix/cachix-action@v12
with:
name: numtide
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: |
nix-build -A docs
cp -r "$(readlink ./result)" book
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: gh-pages
build_dir: book
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}