~cnx/palace

ref: 90528cee2d29b1c4f2078ef7410e530035407199 palace/.github/workflows/docs.yml -rw-r--r-- 1.5 KiB
90528ceeNguyễn Gia Phong Interlink backquoted objects in docstring 1 year, 2 months ago
                                                                                
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: Deploy documentation

on:
  push:
    branches:
    - master
    paths-ignore:
    - examples/**
    - tests/**
    - LICENSE
    - README.md
    - .*.yml

jobs:
  docs:
    runs-on: ubuntu-latest

    steps:
    - name: Setup Python
      uses: actions/setup-python@v2
      with:
        python-version: 3.9.0-beta.4 - 3.9.0

    - name: Checkout palace
      uses: actions/checkout@v2

    - name: Checkout alure
      uses: actions/checkout@v2
      with:
        repository: kcat/alure
        path: alure

    - name: Install dependencies
      run: |
        sudo apt install \
          cmake libopenal-dev libvorbis-dev libopusfile-dev libsndfile1-dev
        cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -S alure -B alure/build
        sudo cmake --build alure/build --parallel `nproc` --target install
        rm -fr alure
        python -m pip install Sphinx .

    - name: Build site
      working-directory: docs
      run: make html

    - name: Configure git
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      run: |
        git config user.email mcsinyx@disroot.org
        git config user.name Nguyễn\ Gia\ Phong
        git remote set-url origin \
          https://token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY
        git fetch origin gh-pages

    - name: Deploy site
      run: |
        git switch gh-pages
        git rm -r .
        shopt -s dotglob
        mv docs/build/html/* .

        rm -r docs
        git add .
        git commit -m "Build at $(date --iso-8601=seconds)"
        git push origin gh-pages