gaspype/.github/workflows/docs.yml

62 lines
1.8 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: Build database
run: |
pip install pyyaml
python thermo_data/combine_data.py thermo_data/combined_data.yaml thermo_data/nasa9*.yaml
python thermo_data/compile_to_bin.py thermo_data/combined_data.yaml src/gaspype/data/therm_data.bin
# echo "Create a dummy file to ensure gaspype does't crash"
# mkdir -p src/gaspype/data
# printf 'gapy\x00\x00\x00\x00' > src/gaspype/data/therm_data.bin
- name: Install gaspype and dependencies
run: |
pip install .[doc_build]
python -m ipykernel install --user --name temp_kernel --display-name "Python (temp_kernel)"
- name: Generate Docs
run: python ./docs/source/generate_class_list.py
- name: Generate Examples
run: python ./docs/source/render_examples.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
- 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