Fakultas Ilmu Komputer UI

.gitlab-ci.yml 962 Bytes
Newer Older
WILLIAM GATES's avatar
WILLIAM GATES committed
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
stages:
  - test
  - deploy

test:
  image: node:latest
  stage: test
  script:
    - npm install
    - npm run test:coverage

staging:
  image: node:latest
  stage: deploy
  variables:
    NETLIFY_AUTH_TOKEN: $STAGING_NETLIFY_AUTH_TOKEN
    NETLIFY_SITE_ID: $STAGING_NETLIFY_SITE_ID
  script:
    - npm install
    - CI="false" npm run build
    - npm install netlify-cli -g
    - netlify deploy --dir "dist" --prod
  only:
    - staging

production:
  image: node:latest
  stage: deploy
  variables:
    AWS_ACCESS_KEY_ID: $PRODUCTION_AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY: $PRODUCTION_AWS_SECRET_ACCESS_KEY
    AWS_STORAGE_BUCKET_NAME: $PRODUCTION_AWS_STORAGE_BUCKET_NAME
  script:
    - npm install
    - CI=false npm run build
    - apt update -y && apt install python3-dev python3-pip zip -y
    - pip3 install awscli
    - cd dist
    - zip -r home-industry.zip *
    - aws s3 cp home-industry.zip s3://$AWS_STORAGE_BUCKET_NAME
  only:
    - master