forked from HarryPerez/wallatest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
91 lines (82 loc) · 1.41 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
stages:
- test
- build
- deploy
workflow:
rules:
- changes:
- packages/front/*
cache:
paths:
- node_modules/
test:
image: node:lts
stage: test
script:
- cd ./packages/front
- npm install
- npm run test
build_dev:
image: node:lts
stage: build
script:
- cd ./packages/front
- npm install
- npm run lint
- npm run build development
- echo "S3_BUCKET=${S3_BUCKET_DEV}" >> build.env
only:
refs:
- development
artifacts:
paths:
- build/
reports:
dotenv: build.env
build_prod:
image: node:lts
stage: build
script:
- cd ./packages/front
- npm install
- npm run lint
- npm run test
- npm run sync-env
- npm run build master
- npm run clean
- mv build/ ${CI_PROJECT_DIR}
- echo "S3_BUCKET=${S3_BUCKET_PROD}" >> build.env
only:
refs:
- master # main
artifacts:
paths:
- build/
reports:
dotenv: build.env
.deploy:
image: ubuntu:latest
script:
- /bin/bash deploy.sh APP_ENV"
.deploy_aws:
image: python:latest
when: manual
script: |
pip install awscli #Install awscli tools
aws s3 sync build/ s3://${S3_BUCKET}
deploy_dev:
extends: .deploy_aws
stage: deploy
dependencies:
- build_dev
only:
refs:
- develop
deploy_prod:
extends: .deploy_aws
stage: deploy
dependencies:
- build_prod
only:
refs:
- master