Update README.md #434
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation | |
| on: | |
| push: | |
| branches: [ main ] # Triggers the workflow on main branch | |
| permissions: | |
| contents: write | |
| jobs: | |
| build_docs_job: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: 3.12 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| python -m pip install sphinx sphinx-rtd-theme myst-nb furo scipy networkx beautifulsoup4 nbsphinx pandoc | |
| - name: Build Sphinx documentation | |
| run: | | |
| make -C docs clean # Clean previous builds | |
| make -C docs html # Build HTML files | |
| ls docs/_build/html # Confirm output files in _build/html | |
| - name: Verify output files | |
| run: | | |
| cat docs/_build/html/index.html # Check the index.html file's initial lines | |
| - name: Deploy to GitHub Pages | |
| run: | | |
| cd docs/_build/html # Change to the built HTML directory | |
| touch .nojekyll # Disable Jekyll | |
| git init | |
| git add . | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git commit -m "Deploy documentation to GitHub Pages" | |
| git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" | |
| git push --force origin HEAD:gh-pages |