File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Building documentation as gh-pages
2+ on :
3+ push :
4+ branches :
5+ - main
6+
7+ jobs :
8+ build_docs :
9+ name : documentation
10+ runs-on : ubuntu-latest # ${{ matrix.platform }}
11+
12+ steps :
13+ # Checkout the repository and setups the machine to use python
14+ - uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0 # otherwise, you will failed to push refs to dest repo
17+ - name : Set up Python
18+ uses : actions/setup-python@v5
19+ with :
20+ python-version : 3.13
21+ - name : generates API documentation and build docs
22+ # You may not run this step if done locally and the documentation was updated manually
23+ # (and those files committed to the repository)
24+ run : |
25+ pip install ".[doc]"
26+ sphinx-apidoc -o ./docs/api ./src/sagittal_average
27+ cd docs
28+ make html
29+ - name : Deploy to GitHub Pages
30+ uses : peaceiris/actions-gh-pages@v4
31+ # Needs change the repository setting (Go to Settings > Actions > General > Workflow permissions)
32+ # - Select "Read and write permissions" to be able to write in the gh-pages branch
33+ with :
34+ publish_branch : gh-pages
35+ github_token : ${{ secrets.GITHUB_TOKEN }}
36+ publish_dir : docs/_build/html
37+ force_orphan : true
38+ # First time it builds and creates the gh-pages, needs to activate the deployment as
39+ # Go to Settings > Pages and select from Build and deployment:
40+ # - Source: Deploy from a branch
41+ # - Branch: `gh-pages` and `/(root)`
Original file line number Diff line number Diff line change 1919 'sphinx.ext.coverage' , # Automatically check if functions are documented
2020 'sphinx.ext.mathjax' , # Allow support for algebra
2121 'sphinx.ext.viewcode' , # Include the source code in documentation
22+ 'sphinx.ext.githubpages' , # Publish HTML docs in GitHub Pages¶
2223]
2324
2425templates_path = ['_templates' ]
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ dev = [
5353 " pytest >= 8" ,
5454 " pytest-cov" ,
5555]
56+ doc = [
57+ " sphinx" ,
58+ ]
59+ all = [" sagittal_average[dev,doc]" ]
5660
5761[project .urls ]
5862Documentation = " https://UCL-COMP0233-24-25.github.io/sagittal_average/"
You can’t perform that action at this time.
0 commit comments