-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
55 lines (49 loc) · 1.07 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
image: public.ecr.aws/sam/build-python3.9:latest-x86_64
stages:
- build
- deploy
before_script:
- curl -O https://nodejs.org/dist/v16.19.1/node-v16.19.1-linux-x64.tar.xz
- tar -xf node-v16.19.1-linux-x64.tar.xz
- mv node-v16.19.1-linux-x64 /usr/local/node
- export PATH=$PATH:/usr/local/node/bin
- rm node-v16.19.1-linux-x64.tar.xz
npm:
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}-npm
paths:
- node_modules/
script:
- npm install
only:
- develop
- master
artifacts:
expire_in: 1 month
paths:
- node_modules/
dev:
stage: deploy
dependencies:
- npm
script:
- npm install -g serverless
- mkdir instance
- cp $CONFIG_FILE instance/config.py
- serverless deploy --region ap-southeast-1 --verbose
environment: dev
only:
- develop
prod:
stage: deploy
dependencies:
- npm
script:
- npm install -g serverless
- mkdir instance
- cp $CONFIG_FILE instance/config.py
- serverless deploy --stage prod --region ap-southeast-1 --verbose
environment: prod
only:
- master