-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.56 KB
/
docs-dev.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
name: Build and Deploy Docs-Dev
on:
push:
branches:
- development # The workflow will be triggered on pushes to the 'development' branch
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# 1. Checkout the code from the 'development' branch
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 1 # Only the last commit is needed for the workflow
# 2. Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11 # Same as the version of Python required in project
# 3. Install dependencies using Poetry
- name: Install dependencies
run: |
pip install poetry
poetry install
poetry add --group dev sphinx sphinx-rtd-theme
source $(poetry env info --path)/bin/activate
# 4. Build the Sphinx documentation
- name: Build Docs
working-directory: docs-dev
run: |
sphinx_exec=$(poetry env info --path)/bin/sphinx-build
make SPHINXBUILD=$sphinx_exec html
# 5. Deploy to the 'gh-pages' branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages # Corrigido: Branch de destino para o deploy
publish_dir: docs-dev/_build/html # Pasta com os arquivos HTML gerados
# keep_files: true # Opcional: mantém arquivos antigos no destino (se necessário)