Skip to content

Deploy docs

Deploy docs #18

Workflow file for this run

name: Deploy docs
on:
push:
tags:
- "*"
workflow_dispatch: {}
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
- name: Cache Poetry
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}-python-3.10
- run: poetry --version
- name: Install dependencies
run: poetry install --all-extras
- name: Get version for deployment
id: get_version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
# For manual runs, get the latest tag
VERSION=$(git describe --tags --abbrev=0)
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
# For tag pushes, use the tag name
VERSION="${{ github.ref_name }}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
fi
- name: fetch from gh-pages
run: git fetch origin gh-pages --depth=1
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy with mike
run: |
poetry run mike deploy -b gh-pages --update-aliases --push "${{ steps.get_version.outputs.version }}" "latest"