Skip to content

pages-build-deployment #287

pages-build-deployment

pages-build-deployment #287

Workflow file for this run

name: pages-build-deployment
on:
push:
pull_request:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build Sphinx documentation
run: |
# Install dependencies
python -m pip install --progress-bar=off .[doc]
# Build the documentation
cd doc || exit
make html
- name: Upload artifact
if: ${{ github.event_name != 'pull_request' }}
uses: actions/upload-pages-artifact@v2
with:
path: doc/build/html
deploy:
name: Deploy documentation
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3