Skip to content

Commit

Permalink
Github action to build and deploy docs
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartmaxwell committed Nov 14, 2024
1 parent 27dcc6e commit f61090f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy Sphinx Documentation

on:
push:
branches: [ main ] # or master, depending on your default branch
workflow_dispatch: # Allows manual trigger

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v2

- name: Set up Python 3.13
run: uv python install 3.13

- name: Install the project
run: uv sync --no-dev --extra docs

- name: Build documentation
run: sphinx-build -b html docs/ docs/_build/

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build

deploy:
needs: build
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
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

0 comments on commit f61090f

Please sign in to comment.