-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tools: add HTML previews for PR containing doc changes #47196
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
we can remove the files when the PR is closed, that will probably cover the majority of PRS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Could it be easily changed to push to a separate repository? I don't want myself and others who regularly fetch the whole repository to be affected by the increase in size. |
Pushing to a different repo shouldn't be a problem. For my own curiosity, what's the use case for fetching the whole repository? |
.github/workflows/doc.yml
Outdated
git add "${{ github.event.pull_request.number }}" | ||
git commit \ | ||
-m "Add/Update preview for ${{ github.event.pull_request.html_url }}" \ | ||
-m "The preview will be available at https://${{ github.repository_owner }}.github.io/${{ github.event.pull_request.base.repo.name }}/${{ github.event.pull_request.number }}/api/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also prefer to use either a different repository or a different URL at least that more clearly indicates that these are not official docs, but rather (untrusted) previews.
As a releaser and V8 maintainer, I regularly fetch everything to have up to date release, staging and canary-base branches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I would prefer we used something on our infra, e.g. Vercel. While this work I feel it would create quite a bit of pain to folks.
For PR containing doc changes, the GitHub Actions workflow will push the built docs to the
gh-pages
branch so reviewers can have a preview of the changes without needing to pull the PR and build the docs locally. The commit that is pushed togh-pages
has a reference to the PR so the commit will appear on the GH web UI (so no need to comment I think).You can see this PR in action on nodejs/node-auto-test#53.
Before this can land (if we do want to land it), the following needs to happen:
gh-pages
branch.Note that this PR is only adding files to the
gh-pages
, which will eventually get cluttered with old PR content. If you have an idea how we can manage, please chime in, otherwise we can leave the problem for our future selves to solve (reseting thegh-pages
branch back to an empty git tree every few months should work well enough for our use case I think)./cc @nodejs/tsc