Build and deploy documentation for stable version #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy documentation for stable version | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build_and_deploy_docs: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
sudo apt update | |
sudo apt install -y pandoc | |
- name: Build docs | |
run: | | |
tox run -e docs | |
- name: Set current version | |
run: | | |
echo "version=$(git describe --tags)" >> "$GITHUB_ENV" | |
- name: Deploy docs | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: docs/_build/html/ | |
target-folder: stable/${{ env.version }} |