Update .gitlab-ci.yml file

This commit is contained in:
odweta
2026-09-07 18:55:57 +02:00
parent 2e76655d48
commit 1dfedd09d6
+9 -6
View File
@@ -21,12 +21,11 @@ stages: # List of stages for jobs, and their order of execution
- test - test
- deploy - deploy
services:
- docker:dind
build-job: # This job runs in the build stage, which runs first. build-job: # This job runs in the build stage, which runs first.
stage: build stage: build
image: docker:latest image: docker:27.5.1-cli
services:
- docker:dind
script: script:
- cd ./app - cd ./app
- echo "Compiling the code..." - echo "Compiling the code..."
@@ -35,16 +34,20 @@ build-job: # This job runs in the build stage, which runs first.
unit-test-job: # This job runs in the test stage. unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully. stage: test # It only starts when the job in the build stage completes successfully.
image: npm:latest image: node:22
script: script:
- cd ./app - cd ./app
- echo "Installing dependencies..."
- npm install
- echo "Running unit tests..." - echo "Running unit tests..."
- npm test - npm test
- echo "Code coverage is 90%" - echo "Code coverage is 90%"
deploy-job: # This job runs in the deploy stage. deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully. stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
image: docker:latest image: docker:27.5.1-cli
services:
- docker:dind
environment: production environment: production
script: script:
- cd ./app - cd ./app