Skip to content

Commit 97a02ec

Browse files
committed
Use Vercel action for continuous documentation
1 parent e057927 commit 97a02ec

File tree

3 files changed

+89
-14
lines changed

3 files changed

+89
-14
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# This workflow deploys documentation to Vercel for previewing PRs
2+
3+
name: Continuous Documentation
4+
5+
on:
6+
pull_request:
7+
pull_request_target:
8+
#paths:
9+
#- 'doc/**'
10+
#- 'examples/**'
11+
#- 'pygmt/**'
12+
#- 'README.rst'
13+
#- '.github/workflows/continuous-documentation.yml'
14+
15+
jobs:
16+
vercel:
17+
name: Deploy to Vercel
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Cancel Previous Runs
22+
uses: styfle/[email protected]
23+
with:
24+
access_token: ${{ github.token }}
25+
26+
- name: Checkout
27+
uses: actions/[email protected]
28+
with:
29+
# fecth all history so that setuptools-scm works
30+
fetch-depth: 0
31+
32+
# Setup Miniconda
33+
- name: Setup Miniconda
34+
uses: conda-incubator/[email protected]
35+
with:
36+
activate-environment: pygmt
37+
python-version: 3.9
38+
channels: conda-forge
39+
miniconda-version: "latest"
40+
41+
- name: Install dependencies
42+
shell: bash -l {0}
43+
run: |
44+
conda install gmt=6.1.1 numpy pandas xarray netcdf4 packaging \
45+
ipython myst-parser sphinx sphinx-copybutton \
46+
sphinx-gallery sphinx_rtd_theme=0.4.3
47+
48+
- name: List installed packages
49+
shell: bash -l {0}
50+
run: conda list
51+
52+
- name: Download remote data from GitHub
53+
uses: dawidd6/[email protected]
54+
with:
55+
workflow: cache_data.yaml
56+
workflow_conclusion: success
57+
name: gmt-cache
58+
path: .gmt
59+
60+
- name: Move and list downloaded remote files
61+
shell: bash -l {0}
62+
run: |
63+
mkdir -p ~/.gmt
64+
mv .gmt/* ~/.gmt
65+
# Change modification times of the two files, so GMT won't refresh it
66+
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
67+
ls -lhR ~/.gmt
68+
69+
- name: Install the package
70+
shell: bash -l {0}
71+
run: |
72+
python setup.py sdist --formats=zip
73+
pip install dist/*
74+
75+
- name: Build the documentation
76+
shell: bash -l {0}
77+
run: make -C doc clean all
78+
79+
- name: Deploy documentation to Vercel
80+
uses: amondnet/[email protected]
81+
with:
82+
# https://vercel.com/account/tokens
83+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
84+
# vercel-org-id and vercel-project-id are generated using vercel CLI
85+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
86+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
87+
github-token: ${{ secrets.GITHUB_TOKEN }}
88+
github-comment: true
89+
working-directory: ./doc/_build/html

package.json

-8
This file was deleted.

vercel.json

-6
This file was deleted.

0 commit comments

Comments
 (0)