Skip to content

0.1.1

0.1.1 #33

Workflow file for this run

name: Documentation
on:
push:
branches: ["main"]
release:
types:
- published
env:
version_path: / # Path for docs. Default is latest
permissions:
contents: write
jobs:
#####################################
# Build and publish the documentation
#####################################
docs:
runs-on: ubuntu-latest
steps:
# Set environment variables for the pathes
- name: Update version_path for releases
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: echo version_path=/version/$(echo $GITHUB_REF | cut -d / -f 3 | cut -d v -f 2- | cut -d . -f 1,2)/ >> $GITHUB_ENV
- name: Update version_path for non-main branches
if: ${{ github.ref_type == 'branch' && github.ref_name != 'main'}}
run: echo version_path=/preview/ >> $GITHUB_ENV
# Checkout repo and build documentation
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dev module and requirements
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Build documentation HTML
run: pdoc ./src/pyventim -o ./docs
# Deploy the page to versioned pages
- name: Deploy to versioned pages
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.GH_PYVENTIM_PAGES }}
branch: gh-pages
folder: docs/
target-folder: ${{ env.version_path }}
clean: true
clean-exclude: '["version"]'