Skip to content

Commit b27ac9e

Browse files
committed
adding workflow
1 parent 2567559 commit b27ac9e

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/readthedocs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update Docs with Versioning
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-docs:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.x
26+
27+
- name: Install Dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install sphinx
31+
32+
- name: Run Sphinx-apidoc
33+
run: |
34+
cd docs
35+
sphinx-apidoc ../src -o ./source
36+
37+
- name: Commit and Push to Generated Docs Branch
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
git config --global user.name "github-actions[bot]"
42+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
43+
git checkout -b generated-docs || git checkout generated-docs
44+
git add .
45+
git commit -m "Update docs for version $GITHUB_REF_NAME [skip ci]" || echo "No changes to commit"
46+
git push origin generated-docs

.readthedocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
33

44
# Required
5-
version: 2
5+
version:
6+
type: tag
67

78
# Set the OS, Python version and other tools you might need
89
build:

0 commit comments

Comments
 (0)