Skip to content

ci: configuration to build-deploy main docs to GitHub Pages #2

ci: configuration to build-deploy main docs to GitHub Pages

ci: configuration to build-deploy main docs to GitHub Pages #2

Workflow file for this run

name: Documentation
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build-main-documentation:
runs-on: ubuntu-22.04
strategy:
max-parallel: 3
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build documentation
run: |
cd docs/
make html
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: main-documentation
path: docs/_build/html
consolidate-documentation:
needs: build-main-documentation
runs-on: ubuntu-22.04
steps:
- name: Download main documentation
uses: actions/download-artifact@v4
with:
name: main-documentation
path: docs
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs
deploy-gh-pages:
needs: consolidate-documentation
runs-on: ubuntu-22.04
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# with:
# preview: true <-> currently not available to the public