-
Notifications
You must be signed in to change notification settings - Fork 228
Use Vercel action for continuous documentation #964
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2075ccb
Use Vercel action for continuous documentation
seisman 42f1b7f
Set default shell to "bash -l {0}"
seisman 4df7267
Update maintenance guides and add instruction about secrets
seisman 59bb101
Merge branch 'master' into vercel-action
seisman 69b65c5
Update MAINTENANCE.md
seisman 9194155
Update MAINTENANCE.md
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# This workflow deploys documentation to Vercel for previewing PRs | ||
|
||
name: Continuous Documentation | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'doc/**' | ||
- 'examples/**' | ||
- 'pygmt/**' | ||
- 'README.rst' | ||
- '.github/workflows/continuous-documentation.yml' | ||
pull_request_target: | ||
paths: | ||
- 'doc/**' | ||
- 'examples/**' | ||
- 'pygmt/**' | ||
- 'README.rst' | ||
- '.github/workflows/continuous-documentation.yml' | ||
|
||
jobs: | ||
vercel: | ||
name: Deploy to Vercel | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
# fecth all history so that setuptools-scm works | ||
fetch-depth: 0 | ||
|
||
# Setup Miniconda | ||
- name: Setup Miniconda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
activate-environment: pygmt | ||
python-version: 3.9 | ||
channels: conda-forge | ||
miniconda-version: "latest" | ||
|
||
- name: Install dependencies | ||
run: | | ||
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 | ||
Comment on lines
+52
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
- name: List installed packages | ||
run: conda list | ||
|
||
- name: Download remote data from GitHub | ||
uses: dawidd6/[email protected] | ||
with: | ||
workflow: cache_data.yaml | ||
workflow_conclusion: success | ||
name: gmt-cache | ||
path: .gmt | ||
|
||
- name: Move and list downloaded remote files | ||
run: | | ||
mkdir -p ~/.gmt | ||
mv .gmt/* ~/.gmt | ||
# Change modification times of the two files, so GMT won't refresh it | ||
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt | ||
ls -lhR ~/.gmt | ||
|
||
- name: Install the package | ||
run: | | ||
python setup.py sdist --formats=zip | ||
pip install dist/* | ||
|
||
- name: Build the documentation | ||
run: make -C doc clean all | ||
|
||
- name: Deploy documentation to Vercel | ||
uses: amondnet/[email protected] | ||
with: | ||
# Generate a vercel token at https://vercel.com/account/tokens, | ||
# and save the value in the secrets setting in the repository. | ||
vercel-token: ${{ secrets.VERCEL_TOKEN }} | ||
# https://github.com/marketplace/actions/vercel-action#project-linking | ||
# Install the Vercel CLI and run `vercel` in the project directory. | ||
# After linking the repository with a Vercel project, `vercel` will | ||
# create a `.vercel` directory containing both the organization (vercel-org-id) | ||
weiji14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# and project (vercel-project-id) id of the project. | ||
# Save the values in the secrets setting in the repository. | ||
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | ||
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-comment: true | ||
weiji14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
working-directory: ./doc/_build/html |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.