-
Notifications
You must be signed in to change notification settings - Fork 146
/
.gitlab-ci.yml
51 lines (45 loc) · 1.14 KB
/
.gitlab-ci.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
image: topocourse/topocourse
stages:
- build
- deploy
execute_ipynbs:
stage: build
script:
- jupyter-book build .
# Workaround of https://github.com/executablebooks/MyST-NB/issues/287
- cp _static/mystnb.css _build/html/_static/
artifacts:
paths:
- _build/html
expire_in: 7d
cache:
- key: global
paths:
- _build/
.upload_website:
stage: deploy
image: eeacms/rsync
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$WEBSITE_UPLOAD_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
script:
- "rsync -ravz _build/html/* -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' [email protected]:$WEBSITE_UPLOAD_PATH"
upload test website:
extends: .upload_website
environment: test
only:
- branches@qt/topocm
except:
- master@qt/topocm
variables:
WEBSITE_UPLOAD_PATH: /test
upload main website:
extends: .upload_website
environment: published
only:
- master@qt/topocm
variables:
WEBSITE_UPLOAD_PATH: /