46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: Deploy Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- 'docs/**'
|
|
- 'mkdocs.yml'
|
|
|
|
jobs:
|
|
deploy:
|
|
if: "startsWith(github.event.head_commit.message, 'Docs(deploy):')"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.7.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: Load cached dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: .venv
|
|
key: venv-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- name: Install dependencies
|
|
run: poetry install --no-interaction --only dev
|
|
|
|
- name: Build documentation
|
|
run: poetry run mkdocs build
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./site
|