-
Notifications
You must be signed in to change notification settings - Fork 15
/
.gitlab-ci.yml
115 lines (105 loc) · 2.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
image: node:12.14
stages:
- test
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .yarn
- cache/Cypress
- node_modules/
before_script:
- echo "MIDGARD_API_IP:" ${MIDGARD_API_IP}
- yarn
- npm i -g firebase-tools
- firebase -V
test:develop:
variables:
# provide cypress with our cached folder to install its cache in
CYPRESS_CACHE_FOLDER: '$CI_PROJECT_DIR/cache/Cypress'
stage: test
except:
- bepswap-testnet-reskin
image: cypress/base:12.14.0
script:
- yarn test
environment:
name: develop
artifacts:
expire_in: 1 week
when: always
paths:
- cypress/screenshots
- cypress/videos
deploy:develop:
stage: deploy
except:
- schedules
script:
- firebase use --token ${FIREBASE_TOKEN} bepswap-testnet-dev
- firebase deploy --token ${FIREBASE_TOKEN}
environment:
name: develop
only:
- master
deploy:staging:
stage: deploy
script:
- firebase use --token ${FIREBASE_TOKEN} bepswap-testnet-staging
- firebase deploy --token ${FIREBASE_TOKEN}
environment:
name: staging
only:
- schedules
deploy:production:
except:
- schedules
stage: deploy
script:
- firebase use --token ${FIREBASE_TOKEN} bepswap-testnet
- firebase deploy --token ${FIREBASE_TOKEN}
environment:
name: production
only:
- master
when: manual
deploy:cloudfront:
stage: deploy
script:
- yarn build
- apt-get update -y && apt install python3-pip -y
- pip3 install --upgrade pip
- pip3 install awscli --upgrade
- make aws-ci-login
- aws s3 cp --recursive build/ s3://${CLOUDFRONT_BUCKET}
only:
- master
# Build docker image
build-docker:
stage: deploy
image: docker:stable
only:
- master
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
before_script:
- apk update
- apk add python py-pip make git jq curl
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
script:
- docker build -t registry.gitlab.com/thorchain/bepswap/bepswap-web-ui .
- docker push registry.gitlab.com/thorchain/bepswap/bepswap-web-ui
deploy:reskin:
stage: deploy
except:
- schedules
script:
- firebase use --token ${FIREBASE_TOKEN} bepswap-testnet-update
- firebase deploy --token ${FIREBASE_TOKEN}
environment:
name: develop
only:
- bepswap-testnet-reskin