-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
39 lines (35 loc) · 1.01 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
image: node:alpine
stages:
- build
- deploy
build-html:
stage: build
script:
- apk add --no-cache zip
- apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing advancecomp
- npm install
- npm run build
- zip -r -j tanky.zip dist/*
- advzip -z -4 tanky.zip
artifacts:
paths:
- tanky.zip
expire_in: 8 days
deploy-html:
stage: deploy
dependencies:
- build-html
script:
- apk update
- apk add --no-cache bash openssh-client zip
- eval `ssh-agent -s`
- echo "$UPSEIL_KEY" > thekey
- chmod 400 thekey
- ssh-add thekey
- mkdir todeploy
- cd todeploy
- unzip ../tanky.zip
- cp ../tanky.zip .
- ssh -o StrictHostKeyChecking=no [email protected] "mkdir -p ~/html/$CI_BUILD_REF_NAME && rm -rf ~/html/$CI_BUILD_REF_NAME/*"
- scp -o StrictHostKeyChecking=no -r * [email protected]:~/html/$CI_BUILD_REF_NAME
- ssh -o StrictHostKeyChecking=no [email protected] "chown -R $UPSEIL_USER:www-data ~/html"