-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (44 loc) · 1.33 KB
/
push-main.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
name: Deploy Sphinx Documentation
on:
push:
branches:
- SPRK-292
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
if: github.ref != 'refs/heads/gh-pages'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda install -y python=3.9 # https://github.com/conda/conda/issues/13560#issuecomment-1992720842
conda env update --file environment.yml --name base
pip install sphinx sphinx_rtd_theme myst_parser sphinxcontrib-autoprogram
- name: Build Documentation
run: |
cd Documentation
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: Documentation/build/html
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/gh-pages'
steps:
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GH_PAGES_PAT }}
publish_dir: Documentation/build/html
allow_empty_commit: 'true'