ci(docs): deploy Pages via Actions instead of a gh-pages branch - #206
Merged
Conversation
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
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>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #203. That PR deployed the docs site by pushing built HTML to a
gh-pagesbranch (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
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 onlypages: write+id-token: write. A compromised docs dependency can no longer push commits.gh-pagescan be deleted and the repo keeps only source.github-pagesenvironment, which is also where protection rules would go.PRs still build with
--strictand never deploy — unchanged.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-pagesauto-created the site. That does not generalize — it worked because I'm an admin on my own fork. On this repo theDocsworkflow ran green and created thegh-pagesbranch, 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
deployjob fails with a Pages-not-configured error;buildis 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, andlance-python-docare allbuild_type: legacyongh-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
mkdocs build --strictpasses; workflow YAML parses with the expected job graph, permissions, and environment.🤖 Generated with Claude Code