|
1 |
| -name: Publish Docs to GitHub Pages |
| 1 | +# .github/workflows/deploy-docs.yml |
| 2 | +name: Deploy Documentation to GitHub Pages |
2 | 3 |
|
3 | 4 | on:
|
4 | 5 | push:
|
5 | 6 | branches:
|
6 |
| - - release # Only trigger on the release branch |
7 |
| - |
8 |
| -permissions: |
9 |
| - contents: read |
10 |
| - pages: write # Required for GitHub Pages API |
11 |
| - id-token: write # Required for authentication |
| 7 | + - release # Change this if your default branch is not 'main' |
| 8 | + workflow_dispatch: |
12 | 9 |
|
13 | 10 | jobs:
|
14 |
| - build: |
15 |
| - runs-on: ubuntu-latest |
| 11 | + build-and-deploy: |
| 12 | + runs-on: ubuntu-22.04 |
16 | 13 |
|
17 | 14 | steps:
|
18 |
| - - name: Checkout code |
19 |
| - uses: actions/checkout@v3 |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v3 |
20 | 17 |
|
21 |
| - - name: Set up Python |
22 |
| - uses: actions/setup-python@v4 |
23 |
| - with: |
24 |
| - python-version: '3.11.9' |
25 |
| - - name: Install dependencies |
26 |
| - run: | |
27 |
| - python -m pip install --upgrade pip |
28 |
| - pip install . |
29 |
| - pip install sphinx==7.4.7 # Install Sphinx and theme if needed |
30 |
| - - name: Move to docs folder |
31 |
| - run: | |
32 |
| - cd docs |
33 |
| - - name: Build Sphinx Docs |
34 |
| - run: | |
35 |
| - make html |
36 |
| - - name: List files in build directory |
37 |
| - run: ls -R ./build/html |
38 |
| - - name: Upload static files as artifact |
39 |
| - id: deployment |
40 |
| - uses: actions/upload-pages-artifact@v3 |
41 |
| - with: |
42 |
| - path: build/html/ |
43 |
| - deploy: |
44 |
| - environment: |
45 |
| - name: github-pages |
46 |
| - url: ${{ steps.deployment.outputs.page_url }} |
47 |
| - runs-on: ubuntu-latest |
48 |
| - needs: build |
49 |
| - steps: |
50 |
| - - name: Deploy to GitHub Pages |
51 |
| - id: deployment |
52 |
| - uses: actions/deploy-pages@v4 |
| 18 | + - name: Set up Python |
| 19 | + uses: actions/setup-python@v4 |
| 20 | + with: |
| 21 | + python-version: 3.11 |
| 22 | + |
| 23 | + - name: Install dependencies |
| 24 | + run: | |
| 25 | + python -m pip install --upgrade pip |
| 26 | + pip install -r docs/source/requirements.txt |
| 27 | +
|
| 28 | + - name: Build documentation |
| 29 | + run: | |
| 30 | + sphinx-build docs/source docs/build/html |
| 31 | +
|
| 32 | + - name: Deploy to GitHub Pages |
| 33 | + uses: peaceiris/actions-gh-pages@v3 |
| 34 | + with: |
| 35 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + publish_dir: docs/build/html |
0 commit comments