This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (44 loc) · 1.57 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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: pip install -r requirements-dev.txt
- 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:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/
target-folder: ${{ env.version_path }}
clean: true
clean-exclude: '["version"]'