-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (36 loc) · 1.29 KB
/
deploy-docs.yml
File metadata and controls
43 lines (36 loc) · 1.29 KB
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 # Trigger the workflow when pushing to the main branch
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x' # Specify your Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # If you have a requirements file
pip install -e .
pip install sphinx # Ensure Sphinx is installed
pip install sphinxawesome-theme # Or any other theme you use
- name: Build Sphinx Documentation
run: |
cd docs
make html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GH_PAGES }} # GitHub token to authenticate
publish_dir: ./docs/build/html # Directory where Sphinx outputs the HTML
destination_dir: '.' # Destination directory in the target branch
keep_files: true # Optional: If you want to keep other files in the gh-pages branch
publish_branch: gh-pages # Branch to deploy to (can be customized)