forked from SPARC-X/SPARC-X-API
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.21 KB
/
publish_doc_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
39
40
41
42
43
44
45
46
47
48
49
50
name: Publish Document Pages for SPARC-X-API
on:
push:
branches:
- master
- 'doc/**'
pull_request:
branches:
- master
paths:
- 'doc/**'
workflow_dispatch:
jobs:
sphinx-build:
defaults:
run:
shell: bash -l {0}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.11"
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: sparc-api-build-doc
- name: Install doc-build dependencies
run: |
pip install -e ".[doc]"
- name: Build sphix doc
run: |
sphinx-build doc doc/_build
- name: Deploy to github pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh_pages
publish_dir: doc/_build
- name: Upload preview when creating pull request
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: docs_build_preview
path: doc/_build