two route net img #30
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: docs_pages_workflow | |
on: | |
push: | |
branches: [ main ] # Triggers the workflow when pushing to the main branch | |
jobs: | |
build_docs_job: | |
runs-on: ubuntu-latest | |
permissions: # Set correct permissions for actions | |
contents: write # This allows pushing to branches | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 # Adjust this version as needed | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install sphinx | |
python -m pip install sphinx-rtd-theme | |
python -m pip install myst-parser # To support Markdown files | |
python -m pip install furo # Install Furo theme | |
- name: Build Sphinx documentation | |
run: | | |
make -C docs clean # Clean previous builds | |
make -C docs html # Build HTML from Sphinx | |
ls | |
- name: Deploy to GitHub Pages | |
run: | | |
cd docs/_build/html # Navigate to the built HTML files | |
touch .nojekyll # Disable Jekyll to serve raw HTML/CSS | |
rm -rf .git # Clean up any existing git repo in the build directory | |
git init # Initialize a new Git repo in the build folder | |
git add . | |
git config --local user.email "[email protected]" | |
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 # Push from 'master' to 'gh-pages' |