-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
51 lines (47 loc) · 1.39 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: "binarapps/node:10"
stages:
- test
- deploy
npm_audit:
image: binarapps/node:10
stage: test
script:
- npm audit --audit-level=moderate
staging_deploy:
stage: deploy
only: ["staging"]
environment:
name: staging
url: https://staging.cargosecurity.online/
variables:
REACT_APP_BACKEND_HOST: admin.staging.cargosecurity.online
REACT_APP_ROUTER_BASENAME: ""
script:
- npm install
- npm run build
- cp build/index.html build/404.html
- apk add --update openssh rsync
- eval $(ssh-agent -s)
- echo "$STAGING_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- "mkdir -p ~/.ssh && chmod 700 ~/.ssh"
- echo "$STAGING_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- "rsync -avze ssh build/. [email protected]:www/."
production_deploy:
stage: deploy
only: ["master"]
environment:
name: production
url: https://cargosecurity.online/
variables:
REACT_APP_BACKEND_HOST: admin.cargosecurity.online
REACT_APP_ROUTER_BASENAME: ""
script:
- npm install
- npm run build
- cp build/index.html build/404.html
- apk add --update openssh rsync
- eval $(ssh-agent -s)
- echo "$PRODUCTION_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- "mkdir -p ~/.ssh && chmod 700 ~/.ssh"
- echo "$PRODUCTION_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- "rsync -avze ssh build/. [email protected]:www/."