|
1 | | -# See: https://circleci.com/docs/2.0/language-python/ |
| 1 | +version: 2.1 |
2 | 2 |
|
3 | | -version: 2 |
4 | | -jobs: |
5 | 3 |
|
| 4 | +jobs: |
6 | 5 | build-docs: |
7 | | - working_directory: ~/repo |
8 | 6 | docker: |
9 | 7 | - image: cimg/python:3.13 |
10 | | - |
11 | 8 | steps: |
12 | 9 | - checkout |
13 | 10 |
|
14 | 11 | - run: |
15 | 12 | name: Install Python dependencies |
16 | 13 | command: | |
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 |
| 14 | + python -m pip install --upgrade pip tox |
25 | 15 |
|
26 | 16 | - run: |
27 | | - name: Build site |
28 | | - no_output_timeout: 30m |
| 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 |
29 | 22 | command: | |
30 | | - # NOTE: blas multithreading behaves badly on circleci |
| 23 | + export BASE_URL="/output/job/$CIRCLE_WORKFLOW_JOB_ID/artifacts/0/$DOCS_PATH" |
31 | 24 | export OMP_NUM_THREADS=1 |
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 |
| 25 | + python -m tox -e py313-buildhtml |
41 | 26 |
|
42 | 27 | - store_artifacts: |
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 | | -
|
| 28 | + path: _build/html |
80 | 29 |
|
81 | 30 | workflows: |
82 | 31 | version: 2 |
83 | | - build: |
| 32 | + build-and-docs: |
84 | 33 | jobs: |
85 | 34 | - build-docs |
86 | | - - deploy-docs: |
87 | | - requires: |
88 | | - - build-docs |
89 | | - filters: |
90 | | - branches: |
91 | | - only: main |
0 commit comments