Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI Docs

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
build-docs:
name: "Build Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # Full history for accurate page timestamps
persist-credentials: false

- uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Install package and dependencies
run: |
python -m pip install uv
uv sync --locked

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.9.38"

- name: Build docs
run: uv run great-docs build

- name: Save docs artifact
uses: actions/upload-artifact@v7
with:
name: docs-html
path: great-docs/_site
include-hidden-files: true

- name: How to preview this build locally
if: github.event_name == 'pull_request'
run: uv run great-docs ci notice --run ${{ github.run_id }} --pr ${{ github.event.number }}

- name: Upload build timings
uses: actions/upload-artifact@v7
with:
name: build-timings
path: great-docs/_site/build-timings.json

publish-docs:
name: "Publish Docs"
runs-on: ubuntu-latest
needs: "build-docs"
if: github.ref == 'refs/heads/main'
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/download-artifact@v7
with:
name: docs-html
path: great-docs/_site

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: great-docs/_site
include-hidden-files: true

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5

preview-docs:
name: "Preview Docs"
runs-on: ubuntu-latest
needs: "build-docs"
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
# Post (and keep updated) a sticky PR comment with the local-preview
# command, pinned to this run so it reproduces the build under review.
# Runs the released great-docs via pipx (no install step needed); kept as
# its own minimal job so the docs build never holds a pull-requests:write
# token. continue-on-error so fork PRs (read-only token) don't fail the run.
- name: Post preview instructions to the PR
continue-on-error: true
run: pipx run great-docs ci pr-comment --run ${{ github.run_id }} --pr ${{ github.event.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,12 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/

# Great Docs build directory (ephemeral, do not commit)
great-docs/

# Great Docs versioned-build artifacts
_great_docs_build/
.great-docs-build/
.great-docs-cache/
.great-docs/
Loading
Loading