debug workflow #43
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 | |
with: | |
fetch-depth: 0 | |
- 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: Check working directory and conf.py existence | |
# run: | | |
# echo "Current Working Directory: $(pwd)" | |
# ls -la ./docs/source/ | |
# if [ -f "./docs/source/conf.py" ]; then | |
# echo "conf.py found." | |
# else | |
# echo "conf.py not found." | |
# fi | |
- name: Print effective Sphinx config | |
run: | | |
CONF_PY="$(pwd)/docs/source/conf.py" | |
echo "Using conf.py located at: $CONF_PY" | |
poetry run python -c "from sphinx.config import Config; config = Config.read('${CONF_PY}'); print(config.values)" | |
- name: Build documentation with detailed logging | |
run: | | |
echo "Building documentation from: $(pwd)/docs/source" | |
poetry run sphinx-build -b html ./docs/source/ ./docs/build/ -vvv | |
- name: List built documentation | |
run: | | |
find ./docs/build/ -type f | |
- 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 | |
publish_dir: ./docs/build/ | |
user_name: github-actions[bot] | |
user_email: github-actions[bot]@users.noreply.github.com | |
- name: Debug Output | |
run: | | |
pwd # Print the current working directory | |
ls -l ./docs/build/ # List files in the build directory | |
cat ./docs/source/conf.py # Show Sphinx config file for debugging |