Skip to content

CI: Store HTML documentation #265

CI: Store HTML documentation

CI: Store HTML documentation #265

name: "Build and deploy documentation"
on:
push:
paths:
- doc/**
- .github/workflows/**
pull_request:
paths:
- doc/**
- .github/workflows/**
workflow_dispatch:
inputs:
perform_deploy:
description: 'Perform deploy to GitHub Pages branch'
required: true
default: false
type: boolean
jobs:
doc-build-and-deploy:
name: Build and deploy documentation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build documentation
uses: ammaraskar/sphinx-action@8.0.2
with:
docs-folder: doc
- name: Deploy documentation
if: ${{ github.event_name == 'workflow_dispatch' && inputs.perform_deploy }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: doc/_build/html
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: html_doc
path: doc/_build/html
retention-days: 7