diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2aee82cd4..3032d34ab8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,45 +58,41 @@ variables: - if: $CI_COMMIT_REF_NAME == "main" - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 -# telling gitlab to collect artifacts from artifacts/ folder to path it to other jobs -.collect-artifacts: &collect-artifacts - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" - when: on_success - expire_in: 2 days - paths: - - artifacts/ - test: stage: test <<: *kubernetes-env <<: *common-refs - <<: *collect-artifacts + cache: + - key: + files: + - package-lock.json + - paths: + - packages/ + - package.json + - package-lock.json script: - - mkdir -p artifacts - cd javascript - npm install # - npm run test - echo testme - - cp -r packages/ ../artifacts/ - - cp package.json ../artifacts/ - - cp package-lock.json ../artifacts/ - - ls -ltr ../artifacts/* build: stage: build <<: *kubernetes-env <<: *common-refs - <<: *collect-artifacts + cache: + - key: + files: + - package-lock.json + - paths: + - packages/ + - package.json + - package-lock.json script: - - mkdir -p artifacts - cd javascript - npm install - npm run clean - npm run build - - cp -r packages/ ../artifacts/ - - cp package.json ../artifacts/ - - cp package-lock.json ../artifacts/ # template task for building and pushing an image .build-push-docker-image: &build-push-docker-image