-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (32 loc) · 779 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
image: docker:stable
stages:
- build
- deploy
cache:
paths:
- ./node_modules/*
build:
stage: build
image: docker/compose
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker-compose build
- docker-compose push
before_script:
- 'which ssh-agent || ( apk update && apk add openssh-client )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
deploy_prod:
stage: deploy
environment:
name: production
url: $URL
when: manual
only:
- master
script:
- ssh -o StrictHostKeyChecking=no $USER@$SERVER_IP 'bash -s' < ./scripts/deploy.sh $ACCESS_TOKEN $CI_COMMIT_SHORT_SHA $EMAIL $EMAIL_PASSWORD