Skip to content

Commit

Permalink
TPASPKT-1017 Publish Sphinx docs using GitHub Pages
Browse files Browse the repository at this point in the history
Publish Sphinx docs to GitHub Pages using GitHub Actions CI service.

The actual docs are located at `<organization>.github.io/<repo>`.
  • Loading branch information
Matoking committed Sep 10, 2024
1 parent 580fb22 commit 6f82263
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
46 changes: 46 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: documentation

on: [push, pull_request]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
# Ubuntu 20.04 has Python 3.9
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements_github.txt
python -m pip install sphinx sphinx-autodoc-typehints
- name: Run Sphinx build
run: make doc
- name: Upload doc artifacts
uses: actions/upload-pages-artifact@v3
with:
path: ./doc/build/html

deploy:
# Only deploy on 'master' branch. It's probably still useful to check
# if the docs actually build on other branches, too.
if: github.ref == 'refs/heads/master'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ After the repository has been added, the package can be installed by running the

Usage
-----
See documentation under ``doc/``.
See the `online documentation`_.

.. _online documentation: https://digital-preservation-finland.github.io/dpres-mets-builder

Installation using Python Virtualenv for development purposes
-------------------------------------------------------------
Expand Down

0 comments on commit 6f82263

Please sign in to comment.