Skip to content

fix: fix docs

fix: fix docs #2

Workflow file for this run

# .github/workflows/sphinx-docs.yaml
# Build Sphinx site for this Poetry-based Python package and publish it into your blog repo at:
# https://diogoribeiro7.github.io/packages/your-python-package/
# Requires a PAT with "repo" scope stored as PERSONAL_ACCESS_TOKEN in *this* repo.
name: sphinx-docs
on:
push:
# branches: [main, develop]
# tags: ['*']
workflow_dispatch:
permissions:
contents: write
jobs:
build-docs:
runs-on: ubuntu-latest
concurrency:
group: sphinx-${{ github.ref }}
cancel-in-progress: true
env:
BLOG_REPO: DiogoRibeiro7/DiogoRibeiro7.github.io
BLOG_DEST: packages/your-python-package
PYTHON_VERSION: '3.11'
steps:
- name: Checkout package repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies with Poetry (docs group)
run: |
poetry install --no-interaction --with docs
- name: Build Sphinx docs (using myst-parser etc.)
run: |
poetry run sphinx-build -b html docs/ site/
- name: Checkout blog repository
uses: actions/checkout@v4
with:
repository: ${{ env.BLOG_REPO }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
path: blog-repo
- name: Copy documentation to blog (includes dotfiles, cleans removed files)
run: |
mkdir -p "blog-repo/${BLOG_DEST}"
rsync -av --delete site/ "blog-repo/${BLOG_DEST}/"
ls -la "blog-repo/${BLOG_DEST}" | sed -n '1,80p'
- name: Commit and push changes to blog
run: |
cd blog-repo
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update your-python-package Sphinx documentation"
git push