-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.39 KB
/
create_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
name: Build and Deploy Sphinx Documentation
on:
push:
branches:
- main # Ветка, на которую нужно реагировать
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
with:
fetch-depth: 0 # Получить всю историю для возможности коммита изменений
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Пример использования Python 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build Sphinx Documentation
run: |
cd docs/source
sphinx-build -b html . ../_build/html # Компиляция документации
- name: Copy Sphinx HTML to docs folder
run: |
mkdir -p ${{ github.workspace }}/docs
cp -R ${{ github.workspace }}/docs/_build/html/* ${{ github.workspace }}/docs
- name: Commit and Push changes
run: |
git config --global user.name 'Your Name'
git config --global user.email 'your-email@example.com'
git add ${{ github.workspace }}/docs
git commit -m "Update documentation" || echo "No changes to commit"
git push