|
1 | | -version: 2.1 |
2 | | - |
| 1 | +# See: https://circleci.com/docs/2.0/language-python/ |
3 | 2 |
|
| 3 | +version: 2 |
4 | 4 | jobs: |
| 5 | + |
5 | 6 | build-docs: |
| 7 | + working_directory: ~/repo |
6 | 8 | docker: |
7 | 9 | - image: cimg/python:3.13 |
| 10 | + |
8 | 11 | steps: |
9 | 12 | - checkout |
10 | 13 |
|
11 | 14 | - run: |
12 | 15 | name: Install Python dependencies |
13 | 16 | command: | |
14 | | - python -m pip install --upgrade pip tox |
| 17 | + python3 -m venv venv |
| 18 | + source venv/bin/activate |
| 19 | + pip install --upgrade pip wheel setuptools |
| 20 | + pip install -r site/requirements.txt -r requirements.txt |
| 21 | +
|
| 22 | + - restore_cache: |
| 23 | + keys: |
| 24 | + - cache-data |
15 | 25 |
|
16 | 26 | - run: |
17 | | - name: Build documentation |
18 | | - no_output_timeout: 60m |
19 | | - environment: |
20 | | - # Ensure this is same as store_artifacts path below |
21 | | - DOCS_PATH: _build/html |
| 27 | + name: Build site |
| 28 | + no_output_timeout: 30m |
22 | 29 | command: | |
23 | | - export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH" |
| 30 | + # NOTE: blas multithreading behaves badly on circleci |
24 | 31 | export OMP_NUM_THREADS=1 |
25 | | - python -m tox -e py313-buildhtml |
| 32 | + source venv/bin/activate |
| 33 | + # n = nitpicky (broken links), W = warnings as errors, |
| 34 | + # T = full tracebacks, keep-going = run to completion even with errors |
| 35 | + make -C site/ SPHINXOPTS="-nWT --keep-going" html |
| 36 | +
|
| 37 | + - save_cache: |
| 38 | + key: cache-data |
| 39 | + paths: |
| 40 | + - _data |
26 | 41 |
|
27 | 42 | - store_artifacts: |
28 | | - path: _build/html |
| 43 | + path: site/_build/html |
| 44 | + |
| 45 | + - persist_to_workspace: |
| 46 | + root: site/_build |
| 47 | + paths: html |
| 48 | + |
| 49 | + deploy-docs: |
| 50 | + working_directory: ~/repo |
| 51 | + docker: |
| 52 | + - image: cimg/python:3.13 |
| 53 | + steps: |
| 54 | + - checkout |
| 55 | + |
| 56 | + - attach_workspace: |
| 57 | + at: site/_build |
| 58 | + |
| 59 | + - run: |
| 60 | + name: install deploy deps |
| 61 | + command : | |
| 62 | + python3 -m pip install --user ghp-import |
| 63 | +
|
| 64 | + - run: |
| 65 | + name: configure git |
| 66 | + command: | |
| 67 | + git config --global user.name "ci-doc-deploy-bot" |
| 68 | + git config --global user.email "ci-doc-deploy-bot@nomail" |
| 69 | + git config --global push.default simple |
| 70 | +
|
| 71 | + - add_ssh_keys: |
| 72 | + fingerprints: |
| 73 | + 5c:54:62:37:75:7f:4d:14:f4:07:82:1c:50:0d:ee:9b |
| 74 | + |
| 75 | + - run: |
| 76 | + name: deploy to gh-pages |
| 77 | + command: | |
| 78 | + ghp-import -n -f -p -m "[skip ci] docs build of $CIRCLE_SHA1" site/_build/html |
| 79 | +
|
29 | 80 |
|
30 | 81 | workflows: |
31 | 82 | version: 2 |
32 | | - build-and-docs: |
| 83 | + build: |
33 | 84 | jobs: |
34 | 85 | - build-docs |
| 86 | + - deploy-docs: |
| 87 | + requires: |
| 88 | + - build-docs |
| 89 | + filters: |
| 90 | + branches: |
| 91 | + only: main |
0 commit comments