.common:
  image: node:12
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - node_modules/
  before_script:
    - node --version
    - yarn --version
    - yarn

test:
  extends: .common
  stage: test
  script:
    - yarn test

pages:
  extends: .common
  stage: deploy
  only:
    - master@holllo/love
  script:
    - yarn build
    - cp 'public/index.html' 'public/404.html'
  artifacts:
    paths:
      - public
