-
Notifications
You must be signed in to change notification settings - Fork 20
78 lines (74 loc) · 2.42 KB
/
buildbook.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: buildbook
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
ipfs-version: [0.12.0]
defaults:
run:
shell: bash -l {0}
env:
IPFSSPEC_GATEWAYS: "http://127.0.0.1:8080"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python modules with conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: how_to_eurec4a
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Install local ipfs node
run: |
sudo apt-get update
sudo apt-get install -y wget curl jq
bash <(curl https://raw.githubusercontent.com/eurec4a/ipfs_tools/main/install_and_run_ipfs.sh) ${{ matrix.ipfs-version }}
- name: setting up notebook execution cache
uses: actions/cache@v3
with:
path: |
how_to_eurec4a/_build/.jupyter_cache
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }}-${{ matrix.ipfs-version }}-${{ matrix.python-version }}
- name: build book
run: |
conda info
jupyter-book build -W -n --keep-going how_to_eurec4a
- name: save execution cache
uses: actions/cache/save@v3
if: always()
with:
path: |
how_to_eurec4a/_build/.jupyter_cache
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }}-${{ matrix.ipfs-version }}-${{ matrix.python-version }}
- name: Archive build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build
path: |
how_to_eurec4a/_build
publish:
needs: build
if: "always() && github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'eurec4a'"
runs-on: ubuntu-latest
steps:
- name: Download compiled book
uses: actions/download-artifact@v3
with:
name: build
path: _build
- name: set CNAME
run: |
printf "howto.eurec4a.eu" > _build/html/CNAME
- name: Publish book on github pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/html