From 4097f455cae8f4172c64d1cc5165778453f9945e Mon Sep 17 00:00:00 2001
From: laurentheirendt <laurent.heirendt@uni.lu>
Date: Fri, 24 Jul 2020 09:37:31 +0200
Subject: [PATCH] prepare index yml

---
 .gitlab-ci.yml | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 31bc9c13..10e95cdf 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,10 +2,29 @@
 image: git-r3lab.uni.lu:4567/r3/docker/jekyll-lcsb:1.6
 
 stages:
+  - prepare
   - build
   - generate
   - deploy
 
+# prepare
+# ------------------------------------------------------------------------------------
+
+prepare:index:
+  image: python
+  stage: prepare
+  rules:
+    - if: $CI_COMMIT_BRANCH
+    - if: $CI_MERGE_REQUEST_ID
+  script:
+    - python .ci/generateIndex.py
+    - mkdir .tmp
+    - cp index.md .tmp/.
+  artifacts:
+    expire_in: 1 day
+    paths:
+      - .tmp
+
 # build
 # ------------------------------------------------------------------------------------
 
@@ -36,6 +55,9 @@ build:pages:
     # Display, which configuration is used
     - 'echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"'
 
+    # retrieve index from previous stage
+    - cp .tmp/index.md .
+
     # Run Jekyll with custom configuration
     - bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
 
-- 
GitLab