From 4d27e99b8219661e18ac94669f8217f51e0565b8 Mon Sep 17 00:00:00 2001
From: Remi  PLANEL <rplanel@pasteur.fr>
Date: Tue, 9 May 2023 13:58:43 +0200
Subject: [PATCH] split in 2 stages

---
 .gitlab-ci.yml | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a622711b..7be7f420 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,18 +1,33 @@
 # The Docker image that will be used to build your app
 image: node:19.5-bullseye-slim
 # Functions that should be executed before the build script is run
-before_script:
-  - npm ci
 
 cache:
   paths:
     - node_modules/
 
+stages:
+  - build
+  - deploy
+
+build:
+  stage: build
+  before_script:
+    - npm ci
+  script:
+    - NUXT_APP_BASE_URL=/wiki/ npm run generate
+  artifacts:
+    paths:
+      - .output/public
+    untracked: false
+    when: on_success
+    expire_in: "30 days"
+
 pages:
+  stage: deploy
   only:
     - main
   script:
-    - NUXT_APP_BASE_URL=/wiki/ npm run generate
     - rm -rf public
     - mv .output/public public
   artifacts:
-- 
GitLab