Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
modified: .github/workflows/sphinx.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
xinetzone committed Dec 12, 2021
1 parent e5664b4 commit e271ad0
Showing 1 changed file with 57 additions and 24 deletions.
81 changes: 57 additions & 24 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,63 @@
name: Sphinx build
name: Deploy to GitHub Pages

on:
on:
push:
branches:
- main
branches: [main]

jobs:
build:
deploy-to-pages:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build HTML
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"
build-command: |
sphinx-build -b html . _build/html
sphinx-build -D language=en -b html . _build/html/en
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: html-docs
path: docs/_build/html/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
- name: 🛎️ Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch all history so that last modified date-times are accurate

- name: 🐍 Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: 🧳 Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
# - name: 👷‍ Install Dot and pandoc
# run: |
# conda install -c conda-forge pandoc
# conda install -c conda-forge ipython
# pip install sphinxcontrib-websupport
# sudo apt update
# sudo apt install -y graphviz

- name: 👷‍ Install dependencies
shell: bash
run: |
pip install --upgrade pip
pip install -r docs/requirements.txt
- name: 🔧 Build HTML
run: |
cd docs
make html
sphinx-build -D language=en -b html ./ _build/html/en
# remove the .doctrees folder when building for deployment as it takes two thirds of disk space
- name: 🔥 Clean up files
run: rm -r docs/_build/doctrees/

- name: 🚀 Deploy to GitHub pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"

0 comments on commit e271ad0

Please sign in to comment.