Skip to content

fix: Glider honors its provider argument instead of building a private pipeline (#226) #454

fix: Glider honors its provider argument instead of building a private pipeline (#226)

fix: Glider honors its provider argument instead of building a private pipeline (#226) #454

Workflow file for this run

name: Documentation
on:
push:
branches: [main]
paths:
- mkdocs.yml
- 'docs/**'
- 'src/**'
- 'scripts/hooks.py'
- 'scripts/generate_api_docs.py'
- 'scripts/generate_cookbooks.py'
- 'scripts/convert_to_gitbook.py'
- '.gitbook.yaml'
- '.github/workflows/docs.yaml'
pull_request:
paths:
- mkdocs.yml
- 'docs/**'
- 'src/**'
- 'scripts/hooks.py'
- 'scripts/generate_api_docs.py'
- 'scripts/generate_cookbooks.py'
- 'scripts/convert_to_gitbook.py'
- '.gitbook.yaml'
- '.github/workflows/docs.yaml'
workflow_dispatch:
jobs:
docs:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install the latest version of uv and set the python version to 3.13
uses: astral-sh/setup-uv@v7
with:
python-version: 3.13
activate-environment: true
- name: Configure git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Install dependencies
run: uv sync --group docs --extra all
- name: Build GitBook site
run: uv run python scripts/convert_to_gitbook.py
- name: Upload generated site as PR artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: gitbook-site-preview
path: site/
- name: Deploy to gitbook-docs branch
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
run: |
cp .gitbook.yaml site/.gitbook.yaml
# Move site/ outside the repo before switching branches
mv site/ /tmp/gitbook-site/
git fetch origin gitbook-docs || true
if git rev-parse --verify origin/gitbook-docs >/dev/null 2>&1; then
git checkout gitbook-docs
else
git checkout --orphan gitbook-docs
git rm -rf .
fi
rsync -a --delete --exclude='.git' /tmp/gitbook-site/ .
git add -A
if ! git diff --cached --quiet; then
git commit -m "docs: update GitBook documentation from ${{ github.sha }}"
git push origin gitbook-docs
fi