Files
semantica/.github/workflows/docs.yml
T
KaifAhmad1 ba0c659700 Add comprehensive documentation website with Sphinx
- Add complete Sphinx documentation structure
- Include API reference, tutorials, and examples
- Add GitHub Actions workflow for auto-deployment
- Include custom CSS and JavaScript for enhanced UI
- Add Makefile with build commands
- Include requirements for documentation dependencies
- Add quick start tutorial and getting started guide
- Configure Read the Docs theme with custom styling
- Add spell checking, link checking, and quality tools
- Set up automatic deployment to GitHub Pages

Documentation includes:
- Getting started guide with installation and basic usage
- Comprehensive examples for all major features
- Complete API reference with type hints
- Tutorials for different use cases
- Custom styling with SemantiCore branding
- Mobile-responsive design
- Dark mode support
- Performance optimization guides
2025-06-26 18:31:50 +05:30

148 lines
3.3 KiB
YAML

name: Build and Deploy Documentation
on:
push:
branches: [ main, develop ]
paths: [ 'docs/**', 'semanticore/**', 'README.md', 'pyproject.toml' ]
pull_request:
branches: [ main ]
paths: [ 'docs/**', 'semanticore/**', 'README.md', 'pyproject.toml' ]
workflow_dispatch:
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[docs,dev]"
pip install sphinx-rtd-theme sphinx-copybutton sphinx-tabs
- name: Build documentation
run: |
cd docs
make html
make linkcheck
- name: Upload documentation artifacts
uses: actions/upload-artifact@v3
with:
name: documentation
path: docs/_build/html/
deploy-docs:
needs: build-docs
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download documentation artifacts
uses: actions/download-artifact@v3
with:
name: documentation
path: docs/_build/html/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
cname: semanticore.readthedocs.io
test-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[docs,dev]"
pip install sphinx-rtd-theme sphinx-copybutton sphinx-tabs
- name: Test documentation build
run: |
cd docs
make html
make linkcheck
make doctest
- name: Check for broken links
run: |
cd docs
make linkcheck 2>&1 | tee linkcheck.log
if grep -q "broken" linkcheck.log; then
echo "Broken links found in documentation"
cat linkcheck.log
exit 1
fi
lint-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install doc8 sphinx-lint
- name: Lint documentation
run: |
doc8 docs/
sphinx-lint docs/
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install sphinxcontrib-spelling
- name: Spell check documentation
run: |
cd docs
make spelling