-
Notifications
You must be signed in to change notification settings - Fork 92
38 lines (36 loc) · 1.03 KB
/
pages.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
name: "pages"
on:
push:
branches:
- "master"
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: crane
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: mdbook build
run: |
mkdir output
nix build --accept-flake-config .#book --out-link result --print-build-logs
rsync -r -L ./result/ ./output
- name: git push
working-directory: output
run: |
git init
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git branch -M gh-pages
git add .
git commit -m "Deploying site"
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
echo "${{ secrets.DEPLOY_KEY }}" | tr -d '\r' | ssh-add -
git push --force "[email protected]:${GITHUB_REPOSITORY}.git" gh-pages