Skip to content

Workflow file for this run

name: Generate Sphinx Documentation
# Add permissions configuration
permissions:
contents: write
on:
push:
branches: [ dev, main ]
pull_request:
branches: [ dev, main ]
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinx sphinx-rtd-theme
- name: Setup Sphinx documentation structure
run: |
mkdir -p docs
cd docs
sphinx-quickstart -q -p "bruhanimate" -a "Ethan Christensen" -v 1.0 -r 1.0 -l en --ext-autodoc --ext-viewcode --makefile --batchfile --sep
echo "" > source/conf.py
echo "import os" >> source/conf.py
echo "import sys" >> source/conf.py
echo "sys.path.insert(0, os.path.abspath('../'))" >> source/conf.py
echo "sys.path.insert(0, os.path.abspath('../../'))" >> source/conf.py
echo "sys.path.insert(0, os.path.abspath('../../bruhanimate'))" >> source/conf.py
echo "project = 'bruhanimate'" >> source/conf.py
echo "copyright = '2024, Ethan Christensen'" >> source/conf.py
echo "author = 'Ethan Christensen'" >> source/conf.py
echo "version = '1.0'" >> source/conf.py
echo "release = '1.0'" >> source/conf.py
echo "extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon']" >> source/conf.py
echo "templates_path = ['_templates']" >> source/conf.py
echo "exclude_patterns = ['demos/*']" >> source/conf.py
echo "language = 'en'" >> source/conf.py
echo "html_theme = 'sphinx_rtd_theme'" >> source/conf.py
echo "html_static_path = ['_static']" >> source/conf.py
echo "bruhanimate documentation" > source/index.rst
echo "Welcome to Your Project's documentation!" >> source/index.rst
echo "=====================================" >> source/index.rst
echo "" >> source/index.rst
echo ".. toctree::" >> source/index.rst
echo " :maxdepth: 2" >> source/index.rst
echo " :caption: bruhanimate:" >> source/index.rst
echo "" >> source/index.rst
echo " bruhanimate.bruhutil" >> source/index.rst
echo " bruhanimate.bruheffect" >> source/index.rst
echo " bruhanimate.bruhrenderer" >> source/index.rst
echo "conf.py file contents"
cat source/conf.py
echo ""
echo "index.rst contents"
cat source/index.rst
- name: Generate .rst files with sphinx-apidoc
run: |
sphinx-apidoc -o docs/source bruhanimate/
- name: Generate Documentation
run: |
cd docs
ls -a
ls source/ -a
make html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html