-
Notifications
You must be signed in to change notification settings - Fork 105
57 lines (47 loc) · 1.27 KB
/
main.yaml
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
name: CI
on:
push:
branches: main
pull_request:
branches: main
# Required to publish to gh-pages branch
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup JupyterBook Cache
uses: actions/cache@v3
with:
path: _build
# NOTE: change key to "jupyterbook-N+1" to force rebuilding cache
key: jupyterbook-0
- uses: ./.github/actions/setupconda
- name: Build JupyterBook
run: |
jupyter-book build .
- name: Dump Build Logs
if: always()
run: |
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html
publish_branch: gh-pages
cname: tutorial.xarray.dev
enable_jekyll: false
- name: Save Build
if: always()
uses: actions/upload-artifact@v3
with:
name: build
path: _build/