-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy path.gitlab-ci.yml
56 lines (50 loc) · 1.2 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
variables:
NODE_VERSION: v14.17.5
APPS_DOMAIN: aia.testingstar.top
stages:
- test
- build
- deploy
before_script:
- wget -q https://nodejs.org/download/release/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.xz
- tar xf node-${NODE_VERSION}-linux-x64.tar.xz
- export PATH=`pwd`/node-${NODE_VERSION}-linux-x64/bin:$PATH
cache:
paths:
- node_modules/
test:
stage: test
script:
- echo "Testing..."
- npm install
- CI=true npm test -- --coverage
- echo "Finish testing..."
only:
- branches
- merge_requests # Execute jobs in merge request context
build:
stage: build
script:
- echo "Building..."
- npm install
- npm run build
- echo "Finish building..."
artifacts:
expire_in: 1 hour
paths:
- build/
only:
- branches
- merge_requests # Execute jobs in merge request context
deploy:
stage: deploy
script:
- echo "Deploying..."
- echo -n "$SSH_KEY" | base64 -d -w 0 > keyfile
- chmod 700 keyfile
- scp -i keyfile -r build/* aia@$APPS_DOMAIN:/var/www/html
environment:
name: deploy
url: http://$APPS_DOMAIN
only:
- master