mirror of https://github.com/Nonannet/pyhoff.git
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Build and Deploy Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v3
|
|
with:
|
|
python-version: "3.x"
|
|
- name: Install package and dependencies
|
|
run: pip install .[doc_build]
|
|
- name: Generate Class List
|
|
run: python ./docs/source/generate_class_list.py
|
|
- name: Build Docs
|
|
run: |
|
|
cp LICENSE docs/source/LICENSE.md
|
|
cd docs
|
|
sphinx-apidoc -o ./source/ ../src/ -M --no-toc
|
|
rm ./source/*.rst
|
|
make html
|
|
touch ./build/html/.nojekyll
|
|
mkdir -p ./build/html/_autogenerated
|
|
cp ./build/html/api/* ./build/html/_autogenerated/
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: docs/build/html
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4 |