65 lines
1.2 KiB
YAML
65 lines
1.2 KiB
YAML
image: node:lts-alpine
|
|
|
|
stages:
|
|
- install
|
|
- lint
|
|
- build
|
|
- publish
|
|
|
|
install:
|
|
stage: install
|
|
script:
|
|
- npm install --prefer-offline
|
|
cache:
|
|
key:
|
|
files:
|
|
- package.json
|
|
paths:
|
|
- node_modules
|
|
|
|
lint:
|
|
stage: lint
|
|
needs: ["install"]
|
|
script:
|
|
- npm run lint
|
|
cache:
|
|
key:
|
|
files:
|
|
- package.json
|
|
paths:
|
|
- node_modules
|
|
policy: pull
|
|
|
|
build:
|
|
stage: build
|
|
needs: ["lint"]
|
|
script:
|
|
- npm run build
|
|
artifacts:
|
|
paths:
|
|
- $CI_PROJECT_DIR/www
|
|
expire_in: 10 minutes
|
|
cache:
|
|
key:
|
|
files:
|
|
- package.json
|
|
paths:
|
|
- node_modules
|
|
policy: pull
|
|
|
|
publish:
|
|
stage: publish
|
|
needs: ["build"]
|
|
image: docker:latest
|
|
services:
|
|
- name: docker:dind
|
|
alias: docker
|
|
script:
|
|
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
|
|
- docker login -u leon.hoppe -p ${CI_REGISTRY_PASSWORD} registry.leon-hoppe.de
|
|
- docker build -t registry.leon-hoppe.de/leon.hoppe/worktime:$VERSION -t registry.leon-hoppe.de/leon.hoppe/worktime:latest .
|
|
- docker push registry.leon-hoppe.de/leon.hoppe/worktime:$VERSION
|
|
- docker push registry.leon-hoppe.de/leon.hoppe/worktime:latest
|
|
only:
|
|
- tags
|