Skip to content

Commit

Permalink
Added Github Pages workflow for Sphinx docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathijs995 committed Apr 30, 2023
1 parent d318bf9 commit 33c47cd
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Workflow for building Sphinx docs and deploying to GH Pages
name: Build Sphinx docs and deploy to GH Pages

on:
# Runs on pushes
push # TODO: Update to push on main branch only before merging to main


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, cancelling in-progress runs.
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "Running on branch ${{ github.ref }} of repository ${{ github.repository }}."
- name: Check out repository code.
uses: actions/checkout@v3
- name: Python environment setup
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies.
run: |
sudo apt-get update
sudo apt-get install libsfml-dev
git submodule sync
git submodule update --init --recursive
python -m pip install -U pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements.dev.txt ]; then pip install -r requirements.dev.txt; fi
pip install -e .
- name: Build HTML docs
run: sphinx-build -b html docs/source/ docs/build/html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs/build/html' # Upload HTML docs only
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 33c47cd

Please sign in to comment.