Skip to content

update: remove duplicate code #2

update: remove duplicate code

update: remove duplicate code #2

Workflow file for this run

name: Build and Deploy Documentation
on:
push:
branches:
- main
- master
paths:
- 'deploy/**'
- 'py_sod_metrics/**'
- '.github/workflows/docs.yml'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
pages: write
id-token: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper git operations
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme
pip install -e .
- name: Build documentation
run: |
cd deploy
sphinx-build -b html . ./_build
- name: Add .nojekyll file
run: |
touch deploy/_build/.nojekyll
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./deploy/_build
publish_branch: gh-pages
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy documentation from ${{ github.sha }}'