-
Notifications
You must be signed in to change notification settings - Fork 13
77 lines (71 loc) · 2.23 KB
/
doc.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
68
69
70
71
72
73
74
75
76
77
name: doc
on:
push:
branches: [ "master" ]
workflow_dispatch:
jobs:
build-docs:
defaults:
run:
shell: bash -el {0}
if: github.repository == 'neurospin/pymultifracs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v2
env:
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
doc-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('meta.yml') }}
- name: Setup python with conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: test
python-version: 3.11
environment-file: meta.yml
use-only-tar-bz2: true
- name: Build doc
shell: bash -el {0}
run: |
conda install -c conda-forge pip sphinx numpydoc pydata-sphinx-theme
python -m pip install .
cd doc
ls $CONDA/envs
export SPHINXBUILD=$CONDA/test/bin/sphinx-build
export SPHINXBUILD=/usr/share/miniconda/envs/test/bin/sphinx-build
make html
touch _build/.nojekyll
- name: Fix permissions
run: |
chmod -c -R +rX "doc/_build" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload gh page artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: doc/_build
retention-days: 1
deploy-docs:
needs: build-docs
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action
with:
token: ${{ secrets.GITHUB_TOKEN }}