forked from ocademy-ai/machine-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (71 loc) · 2.42 KB
/
book-main.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
77
78
79
80
81
name: mainline-deploy-book
# Only run this when the master branch changes
on:
push:
branches:
- main
# If your git repository has the Jupyter Book within some-subfolder next to
# unrelated files, you can make this run only if a file within that specific
# folder has been modified.
#
paths:
- open-machine-learning-jupyter-book/**
- .github/**
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- name: Install drawio
run: |
sudo apt -y install wget curl
curl -s https://api.github.com/repos/jgraph/drawio-desktop/releases/latest | grep browser_download_url | grep '\.deb' | cut -d '"' -f 4 | wget -i -
sudo apt -f install ./drawio-amd64-*.deb
- uses: actions/checkout@v2
# Install dependencies
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Set up conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: open-machine-learning-jupyter-book
environment-file: ./open-machine-learning-jupyter-book/environment.yml
python-version: '3.9'
auto-activate-base: false
auto-update-conda: true
- shell: bash -l {0}
run: |
conda info
# Build the book
- shell: bash -l {0}
name: Build the book
run: |
cd ./open-machine-learning-jupyter-book/
bash ./build-force-all.sh
continue-on-error: false
# Post build the book
- shell: bash -l {0}
name: Post build the book
run: |
cd ./open-machine-learning-jupyter-book/
bash ./post-build.sh
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './open-machine-learning-jupyter-book/_build/html'
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy to netlify from GitHub Actions"
enable-pull-request-comment: false
enable-commit-comment: true
overwrites-pull-request-comment: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1