forked from josephhaddad55/angular-gitlab-ci-cd-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
50 lines (47 loc) · 1.1 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
image: node:10
stages:
- build
- deploy
build:
stage: 'build'
script:
- apt update
- apt-get install -y nodejs
- npm install -y [email protected]
- nodejs -v
- npm -v
- ls -la -F
- npm ci
- npx ng build --prod
cache:
paths:
- node_modules/
artifacts:
when: on_success
name: '$CI_JOB_NAME-$CI_COMMIT_REF_NAME'
paths:
- dist/angular-gitlab-ci-cd-example/
only:
- dev
- master
deploy:
stage: 'deploy'
environment:
name: production
script:
- apt update
- apt install -y software-properties-common
- apt install -y python-dev
- apt install -y python-pip
- pip install awscli
- aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
- aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- aws configure set region us-east-1
- ls -la -F
- mv dist/angular-gitlab-ci-cd-example/appspec.yml dist/
- cd dist
- ls -al -F
- cd ..
- aws deploy push --application-name angular-gitlab-ci-cd-example --s3-location $AWS_S3_LOCATION --ignore-hidden-files --source dist
only:
- master