Skip to content

Switch docs workflow to offical GitHub actions #176

Switch docs workflow to offical GitHub actions

Switch docs workflow to offical GitHub actions #176

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
pull_request:
jobs:
docs:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4 # Uses the Python version in .python-version
- name: Install poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load virtual environment cache
id: cache
uses: actions/cache@v2
with:
path: .venv
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: scripts/setup
- name: Build documentation
run: scripts/docs
- name: Upload artifact
# if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build
- name: Deploy to GitHub Pages
# if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/deploy-pages@v4