stages:
  - prepare
  - build

prepare_node:
  stage: prepare
  image: node:10
  before_script:
    - npm install
  script: 
    - npm run prod
  artifacts:
    paths:
      - node_modules
      - public/css/all.css
  cache:
    # Cache per Branch
    key: "node-$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
    paths:
      - node_modules
  only:
    - branches
    - tags
    
prepare_composer:
  stage: prepare
  image: composer/composer:latest
  script:
    - composer install
  artifacts:
    paths:
      - vendor
  cache:
    key: "composer-$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
    paths:
      - vendor

include:
  - template: Jobs/Build.gitlab-ci.yml