-
Notifications
You must be signed in to change notification settings - Fork 22
67 lines (59 loc) · 2.05 KB
/
documentation_update.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
name: documentation release
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'
permissions:
contents: write
jobs:
testing:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: checkout actions
uses: actions/checkout@v4
- name: Install system packages
run: |
sudo apt-get update -y
sudo apt-get install -y libgl1 libglx-mesa0 libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.8-0' # any version from https://github.com/mamba-org/micromamba-releases
environment-file: environment_dev.yml
init-shell: bash
cache-environment: true
post-cleanup: 'all'
- name: install package
run: |
pip install --upgrade pip
pip install .[docs]
- name: Sphinx build tagged version
if: startsWith(github.ref, 'refs/tags/')
run: |
sphinx-build docs _build/${{ github.ref_name }}
rm -rf _build/stable
mkdir -p _build/stable
sphinx-build docs _build/stable
- name: Sphinx build dev version
if: (github.event_name == 'push' || github.event_name == 'pull_request') && !startsWith(github.ref, 'refs/tags/')
run: |
rm -rf _build/dev
mkdir -p _build/dev
sphinx-build docs _build/dev
- name: Deploy docs to GitHub Pages
if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build
# with next rlease of actions-gh-pages
# issue to allow force_orphan will be fixed
# https://github.com/peaceiris/actions-gh-pages/issues/455
# force_orphan: true
keep_files: true