Skip to content

Commit

Permalink
Use Vercel action for continuous documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Feb 25, 2021
1 parent e057927 commit 97a02ec
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 14 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/continuous-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This workflow deploys documentation to Vercel for previewing PRs

name: Continuous Documentation

on:
pull_request:
pull_request_target:
#paths:
#- 'doc/**'
#- 'examples/**'
#- 'pygmt/**'
#- 'README.rst'
#- '.github/workflows/continuous-documentation.yml'

jobs:
vercel:
name: Deploy to Vercel
runs-on: ubuntu-latest

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
shell: bash -l {0}
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
- name: List installed packages
shell: bash -l {0}
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
shell: bash -l {0}
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
shell: bash -l {0}
run: |
python setup.py sdist --formats=zip
pip install dist/*
- name: Build the documentation
shell: bash -l {0}
run: make -C doc clean all

- name: Deploy documentation to Vercel
uses: amondnet/[email protected]
with:
# https://vercel.com/account/tokens
vercel-token: ${{ secrets.VERCEL_TOKEN }}
# vercel-org-id and vercel-project-id are generated using vercel CLI
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}
github-comment: true
working-directory: ./doc/_build/html
8 changes: 0 additions & 8 deletions package.json

This file was deleted.

6 changes: 0 additions & 6 deletions vercel.json

This file was deleted.

0 comments on commit 97a02ec

Please sign in to comment.