-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
52 lines (47 loc) · 888 Bytes
/
.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
image: node:14-alpine
# Cache modules in between jobs per-branch
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- server/node_modules/
stages:
- build
- test
- deploy
build:
stage: build
tags:
- docker
script:
- cd server
- npm install
test:
stage: test
tags:
- docker
services:
- name: mvertes/alpine-mongo:latest
alias: mongo
variables:
MONGODB_URI: "mongodb://mongo:27017/serverTestDB"
script:
- cd server
- npm run ci-test
deploy:
stage: deploy
tags:
- docker
image: ruby:alpine
script:
- apk update && apk add git curl
- gem install dpl
- dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_API_KEY
environment:
name: production
url: https://$HEROKU_APP_NAME.herokuapp.com/
only:
refs:
- master
variables:
- $HEROKU_APP_NAME
- $HEROKU_API_KEY