Files
WorkTime/.gitlab-ci.yml
2025-02-26 19:44:29 +01:00

62 lines
1.1 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
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
dependencies:
- build