image: node:8 cache: paths: - node_modules before_script: - yarn install stages: - test - build - deploy lint: stage: test script: - yarn run lint flow: stage: test script: - yarn run flow unit: stage: test script: - yarn run test build development: stage: build script: - yarn run build:dev artifacts: expire_in: 1 month paths: - build/dev build beta: stage: build script: - yarn run build:beta artifacts: expire_in: 1 month paths: - build/beta build stable: stage: build script: - yarn run build:stable artifacts: expire_in: 1 month paths: - build/stable deploy review: stage: deploy variables: GIT_STRATEGY: none dependencies: - build development script: - echo "Deploy a review app" - '[ -z "${DEPLOY_BASE_DIR}" ] && echo "Deploy base dir cannot be empty" && exit 255' - env - mkdir -p "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}" - echo "Copy dev build to web server ${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}..." - rsync --delete -va build/dev/ "${DEPLOY_BASE_DIR}/${CI_BUILD_REF_NAME}/" only: - branches tags: - deploy deploy stage beta: stage: deploy variables: GIT_STRATEGY: none when: - manual dependencies: - build beta script: - echo "Deploy staging beta version" only: - beta tags: - deploy deploy stage stable: stage: deploy variables: GIT_STRATEGY: none when: - manual dependencies: - build stable script: - echo "Deploy staging stable version" only: - stable tags: - deploy