
name: Build and Deploy Sphinx Documentation

on:
  push:
    branches:
      - master  # Trigger the workflow on pushes to the master branch

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.10'

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install sphinx
          pip install -r docs/requirements.txt
      - name: Build Sphinx Documentation
        run: |
          sphinx-build -b html docs/source docs/_build/html  # Corrected Sphinx build command
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./docs/_build/html
