summaryrefslogtreecommitdiff
path: root/.github/workflows/update-manual.yml
blob: b6590640f5642d52feaee39148503d2a077005c4 (plain)
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
name: Update manual
on:
  push:
    branches:
    - master
    paths:
    - '**.nix'

jobs:
  update-manual:
    runs-on: macos-12
    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
      with:
        # So that we fetch all branches, since we need to checkout the `gh-pages` branch later.
        fetch-depth: 0

    - name: Install Nix
      uses: cachix/install-nix-action@v20
      with:
        extra_nix_config: |
          access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

    - name: Build manual
      run: |
        nix-build ./release.nix -I nixpkgs=channel:nixpkgs-22.11-darwin -I darwin=. -A manualHTML

    - name: Push update to manual
      run: |
        git checkout gh-pages
        rm -rf manual
        cp -R result/share/doc/darwin manual
        rm result
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add --all
        git commit -m "Update manual"
        git push