-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 1.77 KB
/
pages.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
68
69
70
71
72
73
74
75
76
name: Sphinx build
on:
workflow_run:
workflows: ["Release"]
types:
- completed
workflow_dispatch:
env:
HDF5_DISABLE_VERSION_CHECK: 1
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: dpat
use-mamba: true
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v2
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ matrix.os }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('environment.yml') }}-${{
env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
mamba env update -n dpat -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .["dev"]
- name: Build HTML
run: |
cd docs
make html
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: html-docs
path: docs/build/html/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html