chore(docs): deploy docs on release publish#2323
Open
dancormier wants to merge 4 commits into
Open
Conversation
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
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
Deploy production docs from the release flow instead of ordinary
mainpushes. When Changesets publishes packages frommain, the release workflow calls the Netlify build hook inNETLIFY_DOCS_BUILD_HOOK_URL.This also adds a separate manual
Deploy docsworkflow for the rare case where we intentionally want to deploy the latestpackages/stacks-docscontent frommainwithout publishing a package release.Why
Netlify continuous deployment is still active so PR previews and the
v2branch deploy keep working. Becausemainis also the production branch, normalmainpushes could otherwise deploy production docs even when no package was released.This PR keeps Netlify active, but adds a Netlify ignore guard so production builds only proceed for:
Changes
.github/workflows/main.yml..github/workflows/deploy-docs.ymlfor manual latest-maindocs deploys.packages/stacks-docs/netlify.tomlandnetlify-ignore.shfor Netlify build gating.README.mdwith the release/manual docs deploy behavior.Required Configuration
NETLIFY_DOCS_BUILD_HOOK_URLas a GitHub Actions secret containing the Netlify build hook URL for the docs site. See NetlifyTesting
COMMIT_REF=HEAD bash packages/stacks-docs/netlify-ignore.shverifies a normal non-release production deploy is skipped.CONTEXT=deploy-preview COMMIT_REF=HEAD bash packages/stacks-docs/netlify-ignore.shverifies PR deploy previews are allowed.CONTEXT=branch-deploy COMMIT_REF=HEAD bash packages/stacks-docs/netlify-ignore.shverifies configured branch deploys, likev2, are allowed.INCOMING_HOOK_BODY='{"forceDocsDeploy":true,"source":"workflow_dispatch"}' COMMIT_REF=HEAD bash packages/stacks-docs/netlify-ignore.shverifies the manual deploy payload bypasses the guard.bash -n packages/stacks-docs/netlify-ignore.shverifies the shell script syntax.npm run check -w packages/stacks-docscompleted with existing warnings and no errors.Testing Limits
The full release path cannot be tested before merge without performing a real release from
main;steps.changesets.outputs.published == 'true'only happens when Changesets publishes packages after version bumps land onmain.The first complete production validation of the release path will happen on the next actual package release. The manual workflow also cannot be run from
mainuntil this workflow file exists onmain.Netlify/Terraform Follow-Up
This change uses a Netlify build hook named
GitHub release deploy. It may need to be moved into Terraform as part of STACKS-860. @ttaylor-stackRelated Issue
STACKS-862