Skip to content

Build and Deploy gh-pages sphinx documentation #6

Build and Deploy gh-pages sphinx documentation

Build and Deploy gh-pages sphinx documentation #6

Workflow file for this run

name: Deploy Documentation to GitHub Pages
on:
push:
branches:
- main # Trigger the workflow on push to the main branch
paths:
- 'docs/**' # Trigger only when files in the /docs directory are changed
workflow_dispatch: # This adds the manual trigger
permissions:
id-token: write
contents: write
pages: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Pandoc
run: sudo apt-get install pandoc
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx nbsphinx sphinx_rtd_theme
pip install -r requirements.txt
- name: Build documentation
run: |
cd docs
make html # Build documentation into HTML
- name: Deploy
uses: actions/deploy-pages@v2
with:
token: ${{ secrets.GITHUB_TOKEN }} # GitHub token is required