-
Notifications
You must be signed in to change notification settings - Fork 70
57 lines (49 loc) · 1.54 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
54
55
56
57
name: Generate Documentation
on:
push:
branches:
- autogenerate-docs
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install dependencies
run: |
cd docs/build
pip install -r requirements.txt
- name: Generate documentation
id: generate
run: |
git checkout autogenerate-docs
cd docs/build
python build.py
git diff --quiet && DIFF=false || DIFF=true
git diff
echo $DIFF
echo "diff=$DIFF" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.generate.outputs.diff == 'true'
run: |
echo $GITHUB_OUTPUT
git checkout -b update-docs
git add docs/api-reference
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git commit -m "Update documentation"
git push -u origin update-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Create Pull Request
# uses: peter-evans/create-pull-request@v6
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# branch: update-docs
# title: 'Update Documentation'
# body: 'This PR updates the documentation with the latest changes.'
# labels: 'documentation'