-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
94 lines (85 loc) · 1.88 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
image: "node:latest"
stages:
- test
- build
- deploy
# - cleanup
variables:
AWS_DEFAULT_REGION: us-east-1
BUCKET_NAME: jaam.app
cache:
paths:
- node_modules
test_frontend:
stage: test
script:
- yarn install --pure-lockfile
# - yarn check-ts
- yarn test
only:
- /^issue-.*$/
- dev
- master
build_frontend:
stage: build
script:
- yarn install --pure-lockfile
- yarn build
only:
- /^issue-.*$/
- /^qa-build.*$/
- /^prod-build.*$/
- master
artifacts:
paths:
- dist/
deploys3:
image: "python:latest"
stage: deploy
dependencies:
- build_frontend
only:
- /^never/
before_script:
- pip install awscli
script:
- aws s3 cp dist s3://${BUCKET_NAME} --recursive --exclude index.html
- aws s3 cp dist/index.html s3://${BUCKET_NAME}/index.html --cache-control max-age=0,no-cache,no-store,must-revalidate
environment:
name: ${CI_COMMIT_REF_SLUG}
url: http://${BUCKET_NAME}.s3-website.${AWS_DEFAULT_REGION}.amazonaws.com/${CI_COMMIT_REF_SLUG}
# clean_s3:
# image: "python:latest"
# stage: cleanup
# before_script:
# - pip install awscli
# script:
# - aws s3 rm s3://${BUCKET_NAME}/${CI_COMMIT_REF_SLUG} --recursive # Replace example-bucket with your bucket
# environment:
# name: ${CI_COMMIT_REF_SLUG}
# action: stop
# when: manual
qa_deploy:
extends: deploys3
only:
- /^qa-build.*$/
variables:
NODE_ENV: development
BUCKET_NAME: dev.jaam.app
prod_deploy:
extends: deploys3
only:
- /^prod-build.*$/
- master
variables:
NODE_ENV: production
BUCKET_NAME: jaam.app
when: manual
# build_frontend: # A job to build the static website - replace it with your build methods
# stage: build
# script:
# - yarn install --pure-lockfile
# - yarn build
# artifacts:
# paths:
# - build/ # This is what we want to publish