Skip to content

ci(docs): deploy Pages via Actions instead of a gh-pages branch - #206

Merged
beinan merged 1 commit into
lance-format:mainfrom
beinan:docs/pages-via-actions
Jul 27, 2026
Merged

ci(docs): deploy Pages via Actions instead of a gh-pages branch#206
beinan merged 1 commit into
lance-format:mainfrom
beinan:docs/pages-via-actions

Conversation

@beinan

@beinan beinan commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #203. That PR deployed the docs site by pushing built HTML to a gh-pages branch (mkdocs gh-deploy), matching what lance-namespace / lance-spark / lance-python-doc do. This switches to GitHub's official Pages deployment path — upload-pages-artifact + deploy-pages.

Why

  • Drops contents: write. The old deploy job needed write access to the repository to push a branch. The workflow is now read-only by default, and the deploy job opts into only pages: write + id-token: write. A compromised docs dependency can no longer push commits.
  • No build output in the repo. The site travels as an artifact, so gh-pages can be deleted and the repo keeps only source.
  • Deployment history. Runs are tracked under the github-pages environment, which is also where protection rules would go.
  • Deploy is no longer cancel-in-progress. Cancelling a live site deploy half-way is worse than letting it finish; PR builds stay cancellable.

PRs still build with --strict and never deploy — unchanged.

⚠️ Requires a one-time admin action

Under Settings → Pages → Source, select GitHub Actions.

Worth being explicit about something I got wrong in #203: I claimed no admin action would be required, based on testing on my fork where pushing gh-pages auto-created the site. That does not generalize — it worked because I'm an admin on my own fork. On this repo the Docs workflow ran green and created the gh-pages branch, but the Pages site was never created, so https://lance-format.github.io/lance-context/ is still 404.

Both modes need that same one-time click, so given a maintainer has to touch Settings either way, Actions mode gets the better long-term setup for the same cost. Until the switch is flipped, the deploy job fails with a Pages-not-configured error; build is unaffected, so PR checks stay green.

Note on org convention

This makes lance-context the first repo in the org on Actions mode — lance, lance-spark, lance-namespace, and lance-python-doc are all build_type: legacy on gh-pages. Flagging that deliberately in case you'd rather stay consistent; happy to revert to #203's approach if so, in which case the admin step is instead "Source → Deploy from a branch → gh-pages / root" and the branch is already sitting there ready.

Verification

🤖 Generated with Claude Code

The Docs workflow pushed built HTML to a gh-pages branch with
`mkdocs gh-deploy`. Switch to the official Pages deployment path
(upload-pages-artifact + deploy-pages), which is GitHub's current
recommendation and drops the need to keep build output in a branch.

- No `contents: write`. The workflow is read-only by default; the deploy
  job opts into only `pages: write` + `id-token: write`, so a compromised
  docs build can no longer push to the repository.
- Build output travels as an artifact, so the repo keeps only source and
  the gh-pages branch can be deleted.
- Deploys are tracked under the `github-pages` environment, giving a
  deployment history and a place to hang protection rules.
- Deploy concurrency no longer cancels in-flight runs (cancelling a live
  site deploy mid-flight is worse than letting it finish); PR builds stay
  cancellable.

PRs still build with `--strict` and never deploy.

Note: this needs a one-time repo-admin change under Settings -> Pages,
setting Source to "GitHub Actions". Until then the deploy job fails with
a Pages-not-configured error; the build job is unaffected.

Co-Authored-By: Claude <noreply@anthropic.com>
@beinan
beinan merged commit 32cdcce into lance-format:main Jul 27, 2026
2 checks passed
beinan added a commit that referenced this pull request Jul 27, 2026
## Summary

Switches the docs from a standalone GitHub Pages site to lance.org,
which is how the other subprojects publish.

I'd previously set up Pages here (#203, #206) and asked for the repo's
Pages setting to be enabled. @jackye1995 pointed out that the org
doesn't enable per-subproject Pages by design — public docs should build
into lance.org. He's right, and it turns out the docs are already in
exactly the right shape for it: lance.org is built from the `lance`
repo, whose `make-full-website.sh` copies each subproject's `docs/src`
into the main site.

So the content stays; only the publishing route changes.

## Changes

- **Add `.pages` nav files.** The main site uses the `awesome-pages`
plugin, so navigation must come from `.pages` files rather than a
hardcoded `nav:` block — otherwise these pages render unordered under
lance.org. Enabling the plugin here too keeps local preview and the
published site on one source of truth.
- **Drop the hardcoded `nav:` from `mkdocs.yml`**, now redundant.
- **`site_url` → `https://lance.org/integrations/context/`**, the
address the docs will actually be served from.
- **Remove `.github/workflows/docs.yml`.** It deployed to a Pages site
that doesn't exist and can't be created without an org-level policy
change, so it only ever produced a red X on `main`.

## Verification

Ran `lance/docs/make-full-website.sh` against this checkout and built
the full site: all 12 pages land under `site/integrations/context/`, and
the nav nests correctly (`Quickstart`, `Rollouts (RolloutDB)`, `Rollout
schema`, ... all appear in the sidebar).

## Depends on

lance-format/lance#8014 — until that merges, this repo's docs simply
aren't picked up by the website build. Nothing here breaks in the
meantime; `mkdocs build --strict` still passes locally for preview.

## Follow-ups from the same conversation

Two other things Jack raised, not in this PR:

- **Developer guide → `CONTRIBUTING.md`**, which also auto-builds into
lance.org. The lance-side PR already wires up the copy rule; this repo
has no `CONTRIBUTING.md` yet, so that's a separate change.
- **Discussions** are moving to lance-format/lance/discussions org-wide.

Also worth cleaning up once this lands: the now-unused `gh-pages` branch
on this repo.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant