ci(docs): add docs website automation#1788
Open
pimlock wants to merge 2 commits into
Open
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Route free-form workflow_dispatch inputs through env vars to avoid shell injection, switch uv install to the approved setup-uv action, and add a pytest suite for sync_docs_website.py wired into the test task.
Collaborator
Author
|
/ok to test b94a83b |
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
Note
After this is merged, docs publishing won't change. The state after this is merged is that we have new manual actions that modify the
docs-websitebranch. That branch will later become the source for publishing (see comments under #1296 for more details)sync-docs.ymlworkflow that syncs or removes a single docs snapshot on the generateddocs-websitebranchpublish-docs-website.ymlworkflow for Fern preview or explicit production publishing fromdocs-websitetasks/scripts/sync_docs_website.pywith inlineuvdependencies and YAML-based Fern config updatesTip
Preview build: https://nvidia-preview-multi-version-spike.docs.buildwithfern.com/openshell/
Related Issue
Changes
sync-docs.ymlsupportsoperation=sync|remove,channel=dev|latest|version,source_ref,version_slug, anddisplay_name.concurrency.group: docs-websiteand commits only when generated files change.docs-website, validates with Fern, then publishes either preview or production based on the selected mode.Next Steps
After the manual sync/publish path proves stable, wire this into the release workflows in a follow-up PR:
Make the docs workflows reusable while keeping manual dispatch.
workflow_callinputs tosync-docs.ymlmatching the existingworkflow_dispatchinputs.workflow_callinputs topublish-docs-website.ymlformodeandpreview_id.workflow_dispatchso maintainers can still manually sync/remove versions and manually publish previews.Update
.github/workflows/release-dev.yml.sync-docs.ymlwithoperation=sync,channel=dev, andsource_ref=${{ github.sha }}.publish-docs-website.ymlwithmode=productionso/openshell/dev/...updates on the live docs site.docs-websiteconcurrency group so dev docs syncs cannot race tag docs syncs.Update
.github/workflows/release-tag.yml.Keep historical versions explicit.
sync-docs.ymlruns for selected historical versions, e.g.operation=sync,channel=version,source_ref=v0.0.36,version_slug=v0.0.36.operation=removefor versions we intentionally drop.Using
workflow_callrather thangh workflow runkeeps release jobs synchronous: the release workflow can wait for docs sync and publish to finish, and failures show up in the release run instead of in a detached workflow run.Testing
python3 -m py_compile tasks/scripts/sync_docs_website.pyuv run tasks/scripts/sync_docs_website.py --helpgit diff --cached --checkdocs-websiteworktree:devlatestfromv0.0.57v0.0.36v0.0.48mise run docson the generateddocs-websitebranch: 0 errors, existing Fern warnings onlyNotes
docs-websitebranch has already been published separately.