-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
47 lines (43 loc) · 972 Bytes
/
.gitlab-ci.yml
File metadata and controls
47 lines (43 loc) · 972 Bytes
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
image: node:14.4.0
stages:
- build
- deploy
testbuild:
stage: build
script:
- chmod a+x .config.sh
- ./.config.sh > src/config.js
- npm install --registry https://registry.npm.taobao.org --no-optional
- npm run build
artifacts:
expire_in: 1 week
paths:
- dist
only:
- test
deploy_test:
stage: deploy
image: sebble/deploy
script:
- mkdir -p ~/.ssh
- echo "$GITLAB_DEPLOY_SSH" >> ~/.ssh/id_dsa
- chmod 600 ~/.ssh/id_dsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- ssh -tt "$GITLAB_DEPLOY_USER"@"$GITLAB_DEPLOY_HOST" "mkdir -p /data/www/$CI_PROJECT_NAME"
- rsync -avz dist/* "$GITLAB_DEPLOY_USER"@"$GITLAB_DEPLOY_HOST":/data/www/$CI_PROJECT_NAME
only:
- test
masterbuild:
stage: build
script:
- chmod a+x .config.sh
- ./.config.sh
only:
- master
tagbuild:
stage: build
script:
- chmod a+x .config.sh
- ./.config.sh
only:
- tags