Skip to content

3 setup workflow pages deployment #2

3 setup workflow pages deployment

3 setup workflow pages deployment #2

Workflow file for this run

name: Build and Deploy Documentation
on:
push:
branches:
- '*' # Trigger on push to any branch
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install .[docs]
- name: Build documentation
id: build
run: |
cd docs
sphinx-build -M html ./source ./build
echo "build_dir=$(pwd)/_build/html" >> $GITHUB_ENV
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request' # Only deploy on pull requests
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Deploy documentation
uses: actions/deploy-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html