GeezerVison is showing github.com — Add deploy preview for docs · Issue #82041 · python/cpython
Add deploy preview for docs #82041Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2019-08-14.21:14:46.493>
labels = ['3.9', 'docs']
title = 'Add deploy preview for docs'
updated_at = <Date 2021-03-22.01:23:26.366>
user = 'https://github.com/epicfaace'
bugs.python.org fields:
activity = <Date 2021-03-22.01:23:26.366>
actor = 'epicfaace'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2019-08-14.21:14:46.493>
creator = 'epicfaace'
dependencies = []
files = []
hgrepos = []
issue_num = 37860
keywords = ['patch']
message_count = 7.0
messages = ['349752', '350084', '364264', '364266', '364271', '368201', '389269']
nosy_count = 7.0
nosy_names = ['docs@python', 'willingc', 'EWDurbin', 'Mariatta', 'BTaskaya', 'epicfaace', 'aeros']
pr_nums = ['15288', '18242', '19025']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue37860'
versions = ['Python 3.9']
Activityepicfaace commented on Aug 14, 2019 MannequinAuthor More actions willingc commented on Aug 21, 2019 epicfaace commented on Mar 15, 2020 MannequinAuthor More actions Given Ernest's comment in #15288 (comment) about the limitations of Netlify (1000 build minutes per month), it doesn't seem like Netlify will be a viable alternative.
Instead, I've added a PR (#19025) that takes an alternative approach. It uses GitHub Actions to deploy the docs to the gh-pages branch, then adds a comment to the PR with a link to the deploy preview.
The way this works is that the gh-pages branch has subfolders with the SHA of each commit, and each deploy preview is deployed to each subfolder.
I've enabled this on my fork of cpython -- here's an example PR on my fork: epicfaace#7 epicfaace commented on Mar 15, 2020 MannequinAuthor More actions GitHub Pages has no limit on "build limits" like Netlify does.
One limitation of this approach, though, is that GitHub Pages sites are limited to 1 GB in size. Each doc build is 50 MB, meaning that we could host at a maximum 20 builds. If we needed to, we could resolve this by doing one (or multiple) of the following:
- check with GitHub to see if they will increase the limit for this case
- only build PRs that have been tagged "documentation"
- add a workflow to automatically remove deploy previews after a certain amount of time has passed or after a PR has been merged
- don't deploy on GitHub Pages, but use something like https://surge.sh/, which apparently doesn't have a hard limit on size of a static site
aeros commented on Mar 15, 2020
only build PRs that have been tagged "documentation"
My preference would be to have a "preview-with-netlify" label that could be manually added to use the netlify preview on a case-by-case basis. There are a substantial number of trivial PRs (such as typo fixes and similar minor changes) that are automatically labelled as "documentation" which wouldn't particularly benefit from the netlify preview and would needlessly occupy part of the limit.
Personally, I feel that it most largely benefits more significant documentation changes that involve modification of existing markup or the addition of new markup, rather than all documentation PRs. So a manually added label to trigger it makes the most sense to me. This would be very similar to the recently added "test-with-buildbots" label. epicfaace changed the title [-]Add netlify deploy preview for docs[/-] [+]Add deploy preview for docs[/+] on Mar 16, 2020isidentical commented on May 5, 2020 SponsorMember More actions
Personally, I feel that it most largely benefits more significant documentation changes that involve modification of existing markup or the addition of new markup, rather than all documentation PRs. So a manually added label to trigger it makes the most sense to me. This would be very similar to the recently added "test-with-buildbots" label.
+1, It would be so much useful in cases like GH 19928. epicfaace commented on Mar 22, 2021 MannequinAuthor More actions hugovk commented on Apr 16, 2022 @epicfaace Hi again! Building on GitHub Actions and deploying to Netlify definitely sounds promising and definitely worth a try!
Like you say, we're already building the docs in our own workflow and so it would be good to see how long the upload takes. Reacted by Ashwin Ramaswami hugovk commented on May 8, 2022 I looked into the Netlify action, but there's a blocker; it requires a Netlify personal access token / NETLIFY_AUTH_TOKEN as a secret:
https://github.com/nwtgck/actions-netlify#required-inputs-and-env
And GitHub doesn't make secrets available to PRs from forks, which unfortunately would limit us to uploads only for core devs and only when they created a branch in this repo.
I guess we could hardcode the token without using secrets, but that doesn't sound like a great idea.
Another option, Read the Docs can now build previews for PRs:
https://docs.readthedocs.io/en/stable/pull-requests.html
We're using for PR previews in the PEPs repo, even though the main site is hosted elsewhere (on GitHub Pages).
For example:
As a demo, I've set it up for my fork:
I would recommend naming it something like cpython-docs-previews to make it clear it's not the official docs home, similar to PEPs using pep-previews.
(See also python/docs-community#5 for hosting the live docs on RTD, which is another but related matter. This could be a first step towards that.)
Thoughts on using RTD for PR previews? pradyunsg commented on May 8, 2022 hugovk commented on May 8, 2022 epicfaace commented on May 16, 2022 ContributorAuthor More actions epicfaace commented on May 16, 2022 ContributorAuthor More actions Reacted by Hugo van Kemenade
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|