image: node:lts-alpine stages: - install - lint - build - publish install-mobile: stage: install before_script: - cd src/WorkTime.Mobile script: - npm install --prefer-offline cache: key: files: - package.json paths: - node_modules lint-mobile: stage: lint needs: ["install-mobile"] before_script: - cd src/WorkTime.Mobile script: - npm run lint cache: key: files: - package.json paths: - node_modules policy: pull build-mobile: stage: build needs: ["lint-mobile"] before_script: - cd src/WorkTime.Mobile 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-mobile: stage: publish needs: ["build-mobile"] image: docker:latest services: - name: docker:dind alias: docker before_script: - cd src/WorkTime.Mobile 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