58 lines
1 KiB
YAML
58 lines
1 KiB
YAML
image: node:latest
|
|
|
|
stages:
|
|
- mytest
|
|
- test
|
|
- build
|
|
- deploy
|
|
|
|
cache: &global_cache
|
|
key:
|
|
files:
|
|
- package-lock.json
|
|
policy: pull
|
|
paths:
|
|
- .npm/
|
|
|
|
lint:
|
|
stage: test
|
|
before_script:
|
|
- npm ci --cache .npm --prefer-offline
|
|
script:
|
|
- npm run lint
|
|
cache:
|
|
<<: *global_cache
|
|
policy: pull-push
|
|
|
|
# Test:
|
|
# stage: Test
|
|
# script:
|
|
# - npm test
|
|
# cache:
|
|
# <<: *global_cache
|
|
|
|
build:
|
|
stage: build
|
|
before_script:
|
|
- npm ci --cache .npm --prefer-offline
|
|
script:
|
|
- npm run build
|
|
cache:
|
|
<<: *global_cache
|
|
artifacts:
|
|
paths:
|
|
- dist
|
|
expire_in: 1 week
|
|
|
|
deploy:
|
|
image: ianayoung/rsync:latest
|
|
stage: deploy
|
|
dependencies:
|
|
- build
|
|
script:
|
|
- rsync --delete -az ./dist/ rsync://${DEPLOYMENT_USER}@${DEPLOYMENT_SERVER}:${DEPLOYMENT_PATH}
|
|
environment:
|
|
name: production
|
|
url: https://vtt.f3l.de/
|
|
only:
|
|
- master
|