-
Notifications
You must be signed in to change notification settings - Fork 64
54 lines (51 loc) · 1.25 KB
/
build_deploy.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
# GH actions.
name: Build_Deploy
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
Build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: mlc
environment-file: static/build.yml
- name: Conda info
run: |
conda info
conda list
- name: Install dependencies
run: |
conda install pandoc
pip install git+https://github.com/d2l-ai/d2l-book
- name: Build
run: |
d2lbook build html
- name: Site-Checkout
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.MLC_GITHUB_TOKEN }}
run: |
git clone https://$GITHUB_TOKEN@github.com/mlc-ai/zh
cd zh
git config user.name mlc-bot
git config user.email 106439794+mlc-bot@users.noreply.github.com
cd ..
- name: Deploy
if: github.ref == 'refs/heads/main'
env:
GITHUB_TOKEN: ${{ secrets.MLC_GITHUB_TOKEN }}
run: |
python static/update_site.py --site-path zh --source-path _build/html