Merge pull request #240 from RafaelWO/dependabot/pip/pip-e49d2f513e #126
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: Docs | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '**' | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
- name: Checkout current branch | |
uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dependencies | |
run: | | |
poetry install --only docs | |
- name: Publish docs on push to main (dev) | |
if: github.ref == 'refs/heads/main' | |
run: poetry run mike deploy dev --push | |
- name: Get package version | |
if: startsWith(github.ref, 'refs/tags/') | |
id: check-version | |
run: | | |
echo "VERSION=$(grep 'current_version =' .bumpversion.toml | sed 's/"//g' | awk -F' = ' '{print $2}' | awk -F. '{print $1 "." $2}')" >> $GITHUB_OUTPUT | |
- name: Publish docs on push of tags (latest) | |
if: startsWith(github.ref, 'refs/tags/') | |
run: poetry run mike deploy ${{ steps.check-version.outputs.VERSION }} latest --update-aliases --push |