Created
August 26, 2021 03:16
-
-
Save dipsywong98/9979eaed73767bfe84d3ed7f5b5c89dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:latest | |
services: | |
- redis:latest | |
variables: | |
REDIS_URL: redis://redis:6379 | |
REDIS_PORT: 6379 | |
stages: | |
- install | |
- test | |
- deploy | |
install: | |
stage: install | |
cache: | |
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
script: | |
- yarn install --frozen-lockfile | |
only: | |
changes: | |
- yarn.lock | |
unit: | |
stage: test | |
cache: | |
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
policy: pull | |
script: | |
- yarn test:unit --reporters=default --reporters=jest-junit | |
artifacts: | |
when: always | |
reports: | |
junit: | |
- junit.xml | |
acceptance: | |
stage: test | |
cache: | |
- key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
policy: pull | |
- paths: | |
- coverage/ | |
script: | |
- yarn test:acceptance --reporters=default --reporters=jest-junit | |
artifacts: | |
when: always | |
paths: | |
- coverage/ | |
reports: | |
junit: | |
- junit.xml | |
cobertura: coverage/cobertura-coverage.xml | |
build: | |
stage: test | |
cache: | |
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
policy: pull | |
script: | |
- yarn build | |
artifacts: | |
paths: | |
- dist | |
lint: | |
stage: test | |
cache: | |
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
policy: pull | |
script: | |
- yarn lint | |
deploy: | |
stage: deploy | |
cache: | |
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR | |
paths: | |
- node_modules/ | |
policy: pull | |
script: | |
- apt-get update -qy | |
- apt-get install -y ruby-dev | |
- gem install dpl | |
- dpl --provider=heroku --app=my-app --api-key=$HEROKU_API_KEY_DEV | |
only: | |
- master | |
pages: | |
stage: deploy | |
dependencies: | |
- acceptance | |
script: | |
- mkdir .public | |
- cp -r coverage/* .public | |
- mv .public public | |
artifacts: | |
paths: | |
- public | |
only: | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment