.gitlab-ci.yml 728 Bytes
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1 2 3
variables:
  ARTIFACTS:        "target/app"

Matija Obreza's avatar
Matija Obreza committed
4
stages:
Matija Obreza's avatar
Matija Obreza committed
5
  - build
Matija Obreza's avatar
Matija Obreza committed
6 7
  - publish

Matija Obreza's avatar
Matija Obreza committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
.package_template:  &node_package
  image:            node:8.4-alpine
  cache:
     paths:
       - node_modules/
  before_script:
    - npm install
  artifacts:
    name:           "${CI_PROJECT_NAME}-${CI_COMMIT_REF_NAME}"
    expire_in:      1 day
    paths:
      - ${ARTIFACTS}

webpack:
  <<:               *node_package
  stage:            build
  script:
    - npm run build

Matija Obreza's avatar
Matija Obreza committed
27
pages:
Matija Obreza's avatar
Matija Obreza committed
28
  stage:            publish
Matija Obreza's avatar
Matija Obreza committed
29 30 31 32 33 34
  only:
    - master
  script:
    #  Make public dir for the first run
    - mkdir -p public
    # move scripts to pages folder
Matija Obreza's avatar
Matija Obreza committed
35
    - cp -r ${ARTIFACTS}/* public/
Matija Obreza's avatar
Matija Obreza committed
36 37 38
  artifacts:
    paths:
      - public
Matija Obreza's avatar
Matija Obreza committed
39
    expire_in:      30 minute