add workflow #34
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: Documentation | |
on: | |
push: | |
branches: | |
- xiaoyi_doc # Ensure this is the branch where you commit documentation updates | |
permissions: | |
contents: write | |
actions: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies using Poetry | |
run: | | |
poetry config virtualenvs.create false | |
poetry install | |
- name: Build documentation | |
run: | | |
sphinx-build -b html ./docs/source/ ./docs/build/ -v | |
ls -l ./docs/build/ # List output files for debugging | |
- name: Create .nojekyll file | |
run: touch ./docs/build/.nojekyll | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages # Ensure this is the branch for GitHub Pages | |
publish_dir: ./docs/build/ | |
user_name: github-actions[bot] # Automated commit user name | |
user_email: github-actions[bot]@users.noreply.github.com | |
- name: Debug Output | |
run: | | |
pwd # Print the current working directory | |
ls -l # List files in the current directory | |
cat ./docs/source/conf.py # Show Sphinx config file for debugging |