-
Notifications
You must be signed in to change notification settings - Fork 91
67 lines (64 loc) · 1.91 KB
/
documentation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Documentation
on:
push:
branches:
- main
- documentation
paths:
- earthaccess/**
- tests/**
- docs/**
- notebooks/**
- .github/workflows/documentation.yml
pull_request:
paths:
- earthaccess/**
- tests/**
- docs/**
- notebooks/**
- .github/workflows/documentation.yml
types: [opened, synchronize]
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: false
virtualenvs-path: .venv
installer-parallel: true
- name: Set up cache
uses: actions/cache@v1
id: cache
with:
path: .venv
key: venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install --no-interaction
- name: Build docs
run: poetry run bash scripts/build-docs.sh
env:
EARTHDATA_USERNAME: ${{ secrets.EDL_USERNAME }}
EARTHDATA_PASSWORD: ${{ secrets.EDL_PASSWORD }}
- name: Deploy
if: |
github.event_name == 'push'
&& (github.ref == 'refs/heads/main' || github.ref == 'ref/heads/documentation')
&& github.repository == 'nsidc/earthaccess'
uses: peaceiris/actions-gh-pages@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site