Merge branch 'experiment/generate-docs-test' of https://github.com/Le… #5
This file contains 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: Generate Documentation | |
on: | |
push: | |
branches: | |
- experiment/generate-docs-test # Run the workflow whenever the main branch is updated | |
workflow_dispatch: # Allow manual triggering of the workflow | |
permissions: | |
contents: write # Needed to push changes to the repository | |
jobs: | |
generate-docs: | |
name: Build and Commit Sphinx Docs | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11.8' | |
# Step 3: Install dependencies | |
- name: Install Sphinx and Requirements | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
pip install sphinx sphinx-autobuild playwright | |
# Step 4: Generate Sphinx documentation | |
- name: Build Sphinx Documentation | |
run: | | |
source venv/bin/activate # Activate the virtual environment | |
cd docs | |
sphinx-apidoc -o source/ ../textarena/ | |
make html | |
# Step 5: Commit and Push the Updated Docs | |
- name: Commit and Push Changes | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git add docs/_build | |
git diff --cached --quiet || git commit -m "Update Sphinx documentation" | |
git push origin experiment/generate-docs-test | |