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"] tags: - docker script: - export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//') - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin 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