image: node:latest

stages:
  - build
  - build_documentation

build:
  stage: build
  script:
    - npm install --force --global yarn
    - yarn install
    - yarn test
    - yarn build
    
build-documentation:
  stage: build_documentation
  script:
    - npm install --force --global yarn
    - yarn install
    - npx styleguidist build
    - mv styleguide public
  artifacts:
    paths:
      - public
  only: 
    - master
