forked from m2lines/L96_demo
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.71 KB
/
deploy.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
name: build-and-deploy-book
# Trigger the workflow on push to main branch and PRs
on: [push, pull_request]
# This job installs dependencies, builds the book, and deploys the html
jobs:
build-and-deploy-book:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Get PR number
run: echo "Your PR is ${PR}"
env:
PR: ${{ github.event.pull_request.number }}
- name: 📦 Cache Conda Packages
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda-linux-64.lock') }}
- name: 🐍 Set up Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
activate-environment: L96M2lines
environment-file: conda-linux-64.lock
- name: 👀 Check Conda environment
shell: bash -l {0}
run: |
conda info
conda list
- name: 📦 Cache Notebooks
uses: actions/cache@v2
with:
path: _build/.jupyter_cache
key: notebook_cache-${{hashFiles('_toc.yml', '_config.yml', 'environment.yaml') }}
- name: 📖 Build the book
shell: bash -l {0}
run: |
mkdir -p _notebook_cache
jupyter-book build .
- name: 🚀 Deploy 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
keep_files: false