2020-12-23 18:36:41 +01:00
|
|
|
image: node:latest
|
|
|
|
|
|
|
|
stages:
|
2020-12-27 14:03:14 +01:00
|
|
|
- prepare
|
2020-12-27 13:33:53 +01:00
|
|
|
- test
|
|
|
|
- build
|
|
|
|
- deploy
|
2020-12-23 18:36:41 +01:00
|
|
|
|
2020-12-27 14:03:14 +01:00
|
|
|
cache: &global_cache
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package-lock.json
|
|
|
|
policy: pull
|
|
|
|
untracked: true
|
2020-12-23 20:23:44 +01:00
|
|
|
paths:
|
2020-12-27 14:03:14 +01:00
|
|
|
- node_modules/
|
|
|
|
|
|
|
|
install-dependencies:
|
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- npm ci
|
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
|
|
|
policy: pull-push
|
2020-12-27 14:35:47 +01:00
|
|
|
# only:
|
|
|
|
# changes:
|
|
|
|
# - package-lock.json
|
2020-12-23 20:23:44 +01:00
|
|
|
|
2020-12-27 13:33:53 +01:00
|
|
|
lint:
|
|
|
|
stage: test
|
2020-12-23 20:15:28 +01:00
|
|
|
script:
|
|
|
|
- npm run lint
|
2020-12-27 14:03:14 +01:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-27 13:33:53 +01:00
|
|
|
|
2020-12-23 20:15:28 +01:00
|
|
|
# Test:
|
|
|
|
# stage: Test
|
2020-12-23 20:07:28 +01:00
|
|
|
# script:
|
|
|
|
# - npm test
|
2020-12-27 14:03:14 +01:00
|
|
|
# cache:
|
|
|
|
# <<: *global_cache
|
2020-12-27 13:33:53 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
stage: build
|
|
|
|
script:
|
|
|
|
- npm run build
|
2020-12-27 14:03:14 +01:00
|
|
|
cache:
|
|
|
|
<<: *global_cache
|
2020-12-27 13:33:53 +01:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2020-12-27 14:03:14 +01:00
|
|
|
- dist/
|
2020-12-27 13:33:53 +01:00
|
|
|
expire_in: 1 week
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
stage: deploy
|
|
|
|
dependencies:
|
|
|
|
- build
|
|
|
|
script:
|
|
|
|
- echo "Deploying to production..."
|
|
|
|
- ls dist
|
2020-12-27 14:35:47 +01:00
|
|
|
# environment:
|
|
|
|
# name: production
|
|
|
|
# url: https://vtt.f3l.de/
|
2020-12-27 13:33:53 +01:00
|
|
|
only:
|
|
|
|
- master
|