|
| 1 | +name: HTTomo-backends docs |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + pull_request: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + push: |
| 9 | + branches: |
| 10 | + - main |
| 11 | + |
| 12 | +jobs: |
| 13 | + build-docs-publish: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + defaults: |
| 16 | + run: |
| 17 | + shell: bash -el {0} |
| 18 | + steps: |
| 19 | + - name: Checkout repository code |
| 20 | + uses: actions/checkout@v4 |
| 21 | + |
| 22 | + - name: Setup Python 3.10 |
| 23 | + uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: '3.10' |
| 26 | + |
| 27 | + - name: httomo-backends-docs |
| 28 | + uses: conda-incubator/setup-miniconda@v2 |
| 29 | + with: |
| 30 | + auto-update-conda: false |
| 31 | + activate-environment: httomo-backends-docs |
| 32 | + environment-file: ./docs/source/doc-conda-requirements.yml |
| 33 | + |
| 34 | + - name: Build api docs |
| 35 | + run: sphinx-apidoc -feT -t=./docs/source/_templates -o ./docs/source/api ./httomo_backends |
| 36 | + |
| 37 | + - name: Generate yaml templates |
| 38 | + run: | |
| 39 | + $CONDA/bin/conda activate httomo-backends-docs |
| 40 | + pip install httomolib |
| 41 | + pip install httomolibgpu --no-deps |
| 42 | +
|
| 43 | + - name: Generate yaml templates |
| 44 | + run: | |
| 45 | + python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/tomopy/tomopy_modules.yaml -o ./docs/build/yaml_templates/tomopy |
| 46 | + python ./httomo_backends/scripts/yaml_unsupported_tomopy_remove.py -t ./docs/build/yaml_templates/tomopy -l ./httomo_backends/methods_database/backends/tomopy/tomopy.yaml |
| 47 | + python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/httomolib/httomolib_modules.yaml -o ./docs/build/yaml_templates/httomolib |
| 48 | + python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/httomolibgpu/httomolibgpu_modules.yaml -o ./docs/build/yaml_templates/httomolibgpu |
| 49 | +
|
| 50 | + - name: Generate yml docs |
| 51 | + run: python ./docs/source/yaml_doc_generator.py |
| 52 | + |
| 53 | + - name: Build html |
| 54 | + run: sphinx-build -a -E -b html ./docs/source/ ./docs/build/ |
| 55 | + |
| 56 | + - name: Publish docs |
| 57 | + if: github.ref_type == 'tag' || github.ref_name == 'main' |
| 58 | + run: ghp-import -n -p -f ./docs/build |
| 59 | + env: |
| 60 | + GITHUB_TOKEN: ${{ github.token }} |
0 commit comments