This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |