|
1 | 1 | name: "Sphinx: Render docs" |
2 | 2 |
|
3 | 3 | on: |
4 | | - # Runs on pushes targeting the default branch |
5 | 4 | push: |
6 | 5 | branches: ["main", "master"] |
7 | | - |
8 | | - # Allows you to run this workflow manually from the Actions tab |
9 | 6 | workflow_dispatch: |
10 | 7 |
|
11 | | -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages |
12 | 8 | permissions: |
13 | 9 | contents: write |
14 | 10 | pages: write |
15 | 11 | id-token: write |
16 | 12 |
|
17 | | - |
18 | | -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
19 | | -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
20 | 13 | concurrency: |
21 | 14 | group: "pages" |
22 | 15 | cancel-in-progress: false |
23 | 16 |
|
24 | 17 | jobs: |
25 | | - # This workflow contains a single job called "build" |
26 | 18 | build: |
27 | | - |
28 | | - # The type of runner that the job will run on |
29 | 19 | runs-on: ubuntu-latest |
30 | | - |
31 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
32 | 20 | steps: |
33 | | - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
34 | 21 | - uses: actions/checkout@v2 |
35 | | - |
36 | | - - name: Set up Python 3.10 |
| 22 | + with: |
| 23 | + fetch-depth: 0 |
| 24 | + - name: Set up Python 3.9 |
37 | 25 | uses: actions/setup-python@v2 |
38 | 26 | with: |
39 | | - python-version: "3.10" |
40 | | - |
41 | | - - name: Install dependencies |
| 27 | + python-version: 3.9 |
| 28 | + - name: Add conda to system path |
| 29 | + run: | |
| 30 | + echo $CONDA/bin >> $GITHUB_PATH |
| 31 | + - name: Conda build env for docs |
42 | 32 | run: | |
43 | | - python -m pip install --upgrade pip |
| 33 | + conda env create -f schimpy_env.yml |
| 34 | + source $CONDA/etc/profile.d/conda.sh |
| 35 | + conda activate schimpy |
44 | 36 | pip install -r docsrc/requirements.txt |
45 | | -
|
46 | 37 | - name: Build HTML |
47 | 38 | run: | |
| 39 | + source $CONDA/etc/profile.d/conda.sh |
| 40 | + conda activate schimpy |
48 | 41 | cd docsrc/ |
| 42 | + sphinx-apidoc --force -o . ../schimpy |
| 43 | + make clean |
49 | 44 | make html |
50 | | - |
51 | 45 | - name: Run ghp-import |
52 | 46 | shell: bash |
53 | 47 | env: |
54 | 48 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
55 | 49 | run: | |
| 50 | + source $CONDA/etc/profile.d/conda.sh |
| 51 | + conda activate schimpy |
56 | 52 | git config http.postBuffer 157286400 |
57 | 53 | git pull |
58 | | -
|
59 | 54 | tree -L 2 -a |
60 | | -
|
61 | 55 | ghp-import -n -p -f ./docs/html |
0 commit comments