From 95c0c6746accf522e7433c6b2cb97b5bb920b03b Mon Sep 17 00:00:00 2001
From: Hugo Trentesaux <hugo.trentesaux@lilo.org>
Date: Tue, 6 Jun 2023 11:33:18 +0200
Subject: [PATCH] Update file .gitlab-ci.yml

---
 .gitlab-ci.yml | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 47cf5d9..f7ce23c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,20 +1,27 @@
-# This file is adapted from GitLab template for Rust projects
-
 # Official language image. Look for the different tagged releases at:
 # https://hub.docker.com/r/library/rust/tags/
 image: "rust:latest"
 
-# Optional: Install a C compiler, cmake and git into the container.
-# You will often need this when you (or any of your dependencies) depends on C code.
-# before_script:
-#   - apt-get update -yqq
-#   - apt-get install -yqq --no-install-recommends build-essential
+stages:
+  - build
 
 build:
-  stage: build
+  # image used for this build
   image: rust
+  # build script
   script:
     - cargo build --release
+  # output file
   artifacts:
     paths:
       - target/release/gcli
+  # use cache to avoid re-downloading and re-building all dependencies
+  cache:
+    - key:
+        files:
+          - Cargo.lock
+      paths:
+        - target/release
+  # only build gcli when adding a tag
+  only:
+    - tags
\ No newline at end of file
-- 
GitLab