-
Notifications
You must be signed in to change notification settings - Fork 482
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
Add support for pushing PR previews to a different branch and/or different repo #1307
Conversation
This is ready for review @mortenpi @fredrikekre |
Bump @mortenpi |
I haven't gone through the code in detail yet but glancing at it, it looks good! Will try to go through this within the next few days. Could you also add a note into |
Done! Let me know if the changelog entry is too verbose. |
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 as is!
One tiny request: could we have a test in test/deployconfig.jl
that makes sure that DOCUMENTER_KEY_PREVIEWS
gets properly fetched from the environment too (and gets ignored when it is in the env. but it's not a preview build)? That's the only thing that I saw that wasn't being tested at the moment.
Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
This part is done.
This will be hard. The logic for this part is in the |
Ah, that's right, I didn't look at it closely enough. In that case, I'd say it's good to go. Thanks for the contribution! For planning purposes: would it be fine for you to use Documenter |
@@ -461,13 +484,14 @@ function deploydocs(; | |||
@debug "running extra build steps." | |||
make() | |||
end | |||
@debug "pushing new documentation to remote: '$repo:$branch'." | |||
@debug "pushing new documentation to remote: '$deploy_branch:$branch'." |
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.
deploy_repo
?
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.
Yeah good call
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.
Also :$deploy_branch
?
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.
Yep! #1310
Sounds good! If you remember, just ping me whenever you make the release, so that I can remember to switch from using Documenter |
The docs for how this interface should be used also needs to be updated. |
The fallbacks for @fredrikekre, I guess the related docstring is the one you mean that should get updated? |
Yes. |
Currently, the only way to have PR previews is to put them in the
previews/PRXX
subdirectory in the same branch of the same repository as your actual docs. For example, if your actual docs are pushed to thegh-pages
branch of theMyPackage.jl
repo, then the PR preview for PR number 123 is pushed to thepreviews/PR123
subdirectory in thegh-pages
branch of theMyPackage.jl
repo.But, for a variety of reasons, you may not want to keep your PR previews in the same branch and/or repo as your actual docs.
This PR adds the ability to customize the branch and/or repo to which PR previews are pushed. The options are:
We also add support for the
DOCUMENTER_KEY_PREVIEWS
environment variable. If theDOCUMENTER_KEY_PREVIEWS
environment variable is set, then that will be the SSH key that is used for pushing PR previews. If theDOCUMENTER_KEY_PREVIEWS
environment variable, then the regularDOCUMENTER_KEY
environment variable will be used.Example
Prior art
This is quite easy with Franklin. See e.g. my setup here: