docs/.github/workflows/sphinx.yml

53 lines
1.5 KiB
YAML
Raw Normal View History

2023-06-07 01:19:00 +00:00
name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
2023-06-07 01:22:27 +00:00
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
2023-06-07 01:19:00 +00:00
- name: Install poetry
2023-06-07 01:22:27 +00:00
uses: snok/install-poetry@v1
if: steps.cached-poetry.outputs.cache-hit != 'true'
2023-06-07 01:19:00 +00:00
with:
virtualenvs-create: true
virtualenvs-in-project: true
2023-06-07 01:22:27 +00:00
version: latest
2023-06-07 01:19:00 +00:00
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
2023-06-07 01:25:03 +00:00
run: poetry install --no-root
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
2023-06-07 01:19:00 +00:00
- name: build docs
2023-06-07 01:42:00 +00:00
run: |
poetry run sphinx-build -M html src build
touch build/html/.nojekyll
2023-06-07 01:19:00 +00:00
- name: deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/html