From 4d1f64fe708c6045e8c6ecec915821d99bf3183d Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Mon, 2 Mar 2020 19:34:50 +0200 Subject: [PATCH] Few CI improvements --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e27784f..2671a3b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,36 +1,40 @@ stages: - setup - - qa + - lint - test + - build - publish - deploy -cache: - paths: - - node_modules/ - - dist/ - -setup: +install: image: node:12 stage: setup script: - npm ci + artifacts: + paths: + - node_modules + expire_in: 1 week + es:lint: image: node:12 - stage: qa + needs: ["install"] + stage: lint script: - npm run lint:es sass:lint: image: node:12 - stage: qa + needs: ["install"] + stage: lint script: - npm run lint:sass build: image: node:12 - stage: qa + needs: ["install"] + stage: lint script: - API_URL=http://web.sik.party:8000/api npm run build @@ -42,15 +46,30 @@ build: test:e2e: image: circleci/node:12-browsers + needs: ["install"] stage: test only: - master script: - API_URL=http://web.sik.party:8000/api npm run test:e2e +build: + image: node:12 + needs: ["install"] + stage: build + script: + - npm run build + dependencies: + - install + artifacts: + paths: + - dist + expire_in: 1 week + publish:dev: stage: publish image: docker:stable + needs: ["build", "test:e2e", "es:lint", "sass:lint"] services: - docker:stable-dind only: