.gitlab-ci.yml 509 Bytes
Newer Older
zhaoxuanchao's avatar
zhaoxuanchao committed
1 2 3 4 5 6 7 8 9
image: node:12

cache:
  key: ${CI_COMMIT_SHA}_node_modules
  untracked: true
  paths:
    - node_modules/
  policy: pull-push

zhaoxuanchao's avatar
zhaoxuanchao committed
10
stages:
zhaoxuanchao's avatar
zhaoxuanchao committed
11
  - prepare
zhaoxuanchao's avatar
zhaoxuanchao committed
12
  - build
zhaoxuanchao's avatar
zhaoxuanchao committed
13
  - deploy
zhaoxuanchao's avatar
zhaoxuanchao committed
14 15 16

install_dependencies:
  stage: prepare
zhaoxuanchao's avatar
zhaoxuanchao committed
17
  script:
zhaoxuanchao's avatar
zhaoxuanchao committed
18 19 20 21 22 23 24 25 26
    - yarn install --frozen-lockfile

build_code:
  stage: build
  only:
    - dev
    - beta
    - production
  environment: $CI_COMMIT_BRANCH
zhaoxuanchao's avatar
zhaoxuanchao committed
27
  script:
zhaoxuanchao's avatar
zhaoxuanchao committed
28 29 30 31 32 33 34
    - yarn run build
  artifacts:
    name: "${CI_COMMIT_SHA}_build"
    untracked: true
    paths:
      - build/
    expire_in: 3 hrs