-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
61 lines (55 loc) · 1.23 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
52
53
54
55
56
57
58
59
60
61
image: node:10
stages:
- install
- build
- test
- deploy
install:
stage: install
tags:
- frontend
script:
- npm config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
- npm install --registry=https://registry.npm.taobao.org
cache:
key: ${CI_COMMIT_REF_SLUG}
untracked: true
paths:
- node_modules/
build:
stage: build
tags:
- frontend
script:
- npm run build
artifacts:
paths:
- build
expire_in: 1 week
dependencies:
- install
lint:
stage: test
tags:
- frontend
script:
- npm run lint
dependencies:
- install
allow_failure: true
deploy:
image: eeacms/rsync:latest
stage: deploy
tags:
- frontend
script:
- mkdir -p ~/.ssh && chmod 700 ~/.ssh/
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa_rsync && chmod 600 ~/.ssh/id_rsa_rsync
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rsync -rav -e "ssh -i /root/.ssh/id_rsa_rsync" --delete --chown=git:git ./build/ [email protected]:/var/www/html/stable/qingyou/
- rsync -rav -e "ssh -i /root/.ssh/id_rsa_rsync" --chown=git:git ./build/static/ [email protected]:/var/www/html/stable/static/
dependencies:
- build
only:
- master
when: manual