use poetry for packaging #771
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy | |
on: | |
release: | |
types: [published] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
permissions: | |
contents: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout the repository | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
# 2. Set up Python 3.12 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
# 3. Install dependencies and build the documentation | |
- name: Install dependencies and build docs | |
run: | | |
apt-get install graphviz | |
pip install poetry poetry-dynamic-versioning | |
poetry install --with dev | |
poetry run sphinx-build -j 4 -T -b html docs/source docs/build/html | |
# 4. Deploy the documentation for the 'release' event | |
- name: Deploy Stable 🚀 | |
if: github.event_name == 'release' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/build/html | |
branch: gh-pages | |
# 5. Deploy the documentation for pull requests (Dev version) | |
- name: Deploy Dev 🚀 | |
if: github.event_name == 'pull_request' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/build/html | |
branch: gh-pages | |
target-folder: dev |