ds4/.gitlab-ci.yml

64 lines
1,014 B
YAML
Raw Normal View History

2020-12-23 18:36:41 +01:00
image: node:latest
stages:
- prepare
2020-12-27 13:33:53 +01:00
- test
- build
2020-12-27 15:15:57 +01:00
- deploy
2020-12-23 18:36:41 +01:00
cache: &global_cache
key:
files:
- package-lock.json
policy: pull
untracked: true
2020-12-23 20:23:44 +01:00
paths:
- node_modules/
2020-12-27 17:11:18 +01:00
- .npm/
install-dependencies:
stage: prepare
script:
2020-12-27 17:11:18 +01:00
- npm ci --cache .npm --prefer-offline
cache:
<<: *global_cache
policy: pull-push
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
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
# cache:
# <<: *global_cache
2020-12-27 13:33:53 +01:00
build:
stage: build
script:
- npm run build
cache:
<<: *global_cache
2020-12-27 15:19:20 +01:00
artifacts:
paths:
2020-12-27 15:25:05 +01:00
- dist
2020-12-27 16:43:20 +01:00
expire_in: 1 week
2020-12-27 16:38:16 +01:00
2020-12-27 15:15:57 +01:00
deploy:
stage: deploy
2020-12-27 16:38:16 +01:00
dependencies:
- build
2020-12-27 15:15:57 +01:00
script:
- echo "Deploying to production..."
2020-12-27 16:38:16 +01:00
- ls dist
environment:
name: production
url: https://vtt.f3l.de/
2020-12-27 15:15:57 +01:00
only:
- master