-
Notifications
You must be signed in to change notification settings - Fork 85
59 lines (46 loc) · 1.51 KB
/
book.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
name: Deploy Book
on:
push:
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy-unstable:
name: Deploy
runs-on: ubuntu-latest
if: github.repository == 'zhaofengli/attic'
steps:
- uses: actions/checkout@v4.1.7
- uses: DeterminateSystems/nix-installer-action@v15
continue-on-error: true # Self-hosted runners already have Nix installed
- name: Install Attic
run: ./.github/install-attic-ci.sh
- name: Configure Attic
run: |
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
attic login staging https://staging.attic.rs/ "$ATTIC_TOKEN"
attic use attic-ci
env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}
- name: Build book
run: nix build .#book -L
- name: Copy book artifact
run: |
cp --recursive --dereference --no-preserve=mode,ownership result public
- name: Upload book artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: public
- name: Deploy book
uses: actions/deploy-pages@v4.0.5
# TODO: Just take a diff of the list of store paths, also abstract all of this out
- name: Push build artifacts
run: |
export PATH=$HOME/.nix-profile/bin:$PATH # FIXME
if [ -n "$ATTIC_TOKEN" ]; then
nix build .#book --no-link --print-out-paths -L | \
xargs attic push attic-ci
fi
env:
ATTIC_TOKEN: ${{ secrets.ATTIC_TOKEN }}