stages:
  - compile
  - deploy

dist:
  stage: compile
  image: node:current
  cache:
    paths:
      - node_modules/
  script:
    - npm install
    - npm run dist
  only:
    - master
  artifacts:
    paths:
      - dist/index.js

pages:
  stage: deploy
  script:
    - mkdir .public
    - cp -r dist demo .public
    - mv .public public
  artifacts:
    paths:
      - public
  only:
    - master
