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
- deploy
services:
- docker:dind
build-job: # This job runs in the build stage, which runs first.
stage: build
image: docker:latest
image: docker:27.5.1-cli
services:
- docker:dind
script:
- cd ./app
- 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.
stage: test # It only starts when the job in the build stage completes successfully.
image: npm:latest
image: node:22
script:
- cd ./app
- echo "Installing dependencies..."
- npm install
- echo "Running unit tests..."
- npm test
- echo "Code coverage is 90%"
deploy-job: # This job runs in the deploy stage.
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
script:
- cd ./app