-
Notifications
You must be signed in to change notification settings - Fork 224
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
Use Vercel action for continuous documentation #964
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/gmt/pygmt/F8Yc5DfYt23Aep1zxaQ3zYViuhKM |
bf5f180
to
2aa9088
Compare
Deploy preview for pygmt ready! ✅ Preview Built with commit 9194155. |
b2df534
to
07851f2
Compare
f460c11
to
efa35ac
Compare
efa35ac
to
97a02ec
Compare
97a02ec
to
2075ccb
Compare
Ping @GenericMappingTools/python and @GenericMappingTools/python-maintainers for comments about the new workflow, especially that if you feel that the comment below is annoying. Ping @weiji14 who implemented the old Vercel App, and wrote the two configurations. Ping @meghanrjones as it's likely that we will use the same action in GMT as mentioned in GenericMappingTools/gmt#4848 (comment). |
I think the new comment structure is a worthwhile trade off for fewer files and easier maintenance. It will be nice to have consistency with continuous documentation between PyGMT and GMT. |
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.
A few things to address documentation wise on the "Continuous Documentation" section in MAINTENANCE.md:
- Remove references to
package.json
andvercel.json
. - Mention how the secrets
VERCEL_ORG_ID
,VERCEL_PROJECT_ID
andVERCEL_TOKEN
are created, and how they can be updated (i.e. link to the Vercel page).
Optional points:
- Can we set up a matrix build on all 3 OSes in this action? I.e. remove the "Build the documentation" section in
ci_tests.yaml
and put it here instead.
Rationale: Saves ~4min of CI time. I wanted to separate the tests from the documentation builds in #830, but maybe we can do it in this "Continuous Documentation" workflow instead. I know Leo mentioned using the documentation build as a 'test' before (lazy to dig up that comment), but our >20 min of CI tests is getting wayy too long.
Will do.
What about writing the instructions in the workflow file, so the workflow is self-contained and the maintenance guide is short. |
Yep, an inline comment with the Vercel documentation link works too! |
conda install gmt=6.1.1 numpy pandas xarray netcdf4 packaging \ | ||
ipython myst-parser sphinx sphinx-copybutton \ | ||
sphinx-gallery sphinx_rtd_theme=0.4.3 |
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.
Here I only install the packages required for documentation, to save the building time.
I'm OK with separate workflows for docs and tests. We can try it in a separate PR. |
Co-authored-by: Wei Ji <[email protected]>
Co-authored-by: Wei Ji <[email protected]>
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.
14 lines to 99 lines of code to get rid of 2 files. Hope this is worth it 😆
P.S. Remember to uninstall the Vercel App later @seisman.
Just disabled the App in this repository, because it's still used by https://github.com/GenericMappingTools/website. |
- Switch from the Vercel App to the Vercel action - Remove the old configuration files `package.json` and `vercel.json` - Update the maintenance guide Co-authored-by: Wei Ji <[email protected]>
…Tools#973) * Revert "Disable pull_request_target for the vercel action (GenericMappingTools#969)" This reverts commit f455c31. * Revert "Use Vercel action for continuous documentation (GenericMappingTools#964)" This reverts commit 17133d1.
Description of proposed changes
For Continous Documentation (i.e., previewing documentation in PRs), we're currently using the Vercel App. To make the app work, we need two configuration files in the repository root directory,
package.json
andvercel.json
. The Vercel App works well for PyGMT, but is more challenging for GMT (GenericMappingTools/gmt#4848 (comment)).This PR adds a new workflow using the vercel-action action.
The new Vercel action has the following pros:
package.json
andvercel.json
are no longer needed. Two fewer files in the root directoryThe new Vercel action also has some cons:
After the first build finishes, the action creates a comment, showing the preview URL. For the following builds, the action updates the preview URL in the comment. So PR authors and maintainers will be notified once by the action. It's noisier than the old Vercel App.
The comment only shows the preview URL of the latest build, so it's not easy to compare the documentation of two builds. It's still possible to get old preview URLs by checking the workflow output.
The workflow takes ~7 minutes, slightly slower than the old Vercel App (~6 minutes).
Notes:
You may notice that the Vercel App also creates a comment and still show the "View deployment" buttons, even though we already remove the
package.json
andvercel.json
files. That's simply because we still have the Vercel App installed and enabled for this repository. We should diable the Vercel App if we decide to use the new workflow.TODO
Fixes #
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version