From 6e3d2b15e10028aeccd7c0acfa158732a6daec40 Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 3 Oct 2024 16:52:47 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a3fee0a..20a5cdb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,19 @@ -merge: - image: docker:cli - stage: test - services: - - docker:dind - variables: - DOCKER_IMAGE_NAME: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG +install: + image: node:21.7.3 + before_script: + - corepack enable + - pnpm config set store-dir .pnpm-store script: - - docker build -t "$DOCKER_IMAGE_NAME" . - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + - pnpm install + cache: + key: + files: + - pnpm-lock.yaml + paths: + - .pnpm-store build: image: docker:cli - stage: build services: - docker:dind variables: @@ -25,4 +26,6 @@ build: docker tag "$DOCKER_IMAGE_NAME" "$CI_REGISTRY_IMAGE:main" docker push "$CI_REGISTRY_IMAGE:main" rules: - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' \ No newline at end of file + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + dependencies: + - install \ No newline at end of file