mirror of
https://github.com/MadcowD/ell.git
synced 2024-09-22 16:14:36 +03:00
53 lines
1.5 KiB
YAML
53 lines
1.5 KiB
YAML
name: Build and Deploy Sphinx Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main # Trigger the workflow only on pushes to the main branch
|
|
|
|
# Add this permissions block
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.12.4' # Specify the Python version
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.5.1
|
|
|
|
- name: Install project dependencies
|
|
run: poetry install
|
|
|
|
- name: Install doc-specific dependencies
|
|
run: |
|
|
cd docs
|
|
poetry run pip install -r requirements.txt
|
|
|
|
- name: Build the documentation
|
|
run: |
|
|
cd docs
|
|
rm -rf _build # Remove existing build directory
|
|
poetry run make html # Use poetry run to ensure the correct environment is used
|
|
poetry run python -c "import ell; version = ell.__version__; print(version); open('_build/html/_static/ell_version.txt', 'w').write(version)"
|
|
|
|
# env:
|
|
# SPHINXOPTS: "-W" # Treat warnings as errors
|
|
|
|
- name: Deploy to GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./docs/_build/html # Path to the built documentation
|
|
cname: docs.ell.so |