Skip to content

Commit 06c8118

Browse files
Workflow GitHub Actions per documentazione
1 parent e2c0994 commit 06c8118

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build-and-deploy:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install -r docs/requirements.txt
28+
29+
- name: Build documentation
30+
run: |
31+
cd docs
32+
sphinx-build -b html . _build/html
33+
34+
- name: Deploy to GitHub Pages
35+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
36+
uses: peaceiris/actions-gh-pages@v4
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: ./docs/_build/html
40+
force_orphan: true

0 commit comments

Comments
 (0)