diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6f8bfad6a355ed93d7d2bde61095507312ed7157..509940d7f1d8aaae6323b558a721385ace5981cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,7 +10,9 @@ stages:
 
 before_script:
   - pip install -r requirements.txt
-  - pip install .
+
+variables:
+  GIT_LFS_SKIP_SMUDGE: 1
 
 cache:
   paths:
@@ -21,7 +23,10 @@ pylint:
     - pylint lisainstrument
 
 pytest:
+  variables:
+    GIT_LFS_SKIP_SMUDGE: 0
   script:
+    - pip install .
     - python -m pytest -v --junitxml=report.xml
   artifacts:
     reports:
@@ -39,14 +44,15 @@ dist:
 
 tag-latest:
   stage: deploy
-  image: alpine/git
-  script:
+  image: datamachines/git-lfs
+  before_script:
+    - git config http.sslverify false
     - git config user.email "${GITLAB_USER_EMAIL}"
     - git config user.name "${GITLAB_USER_NAME}"
-    - git remote add tag-origin https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.in2p3.fr/${CI_PROJECT_PATH}
-    - git push --delete tag-origin latest
-    - git tag latest
-    - git push tag-origin latest
+    - git remote set-url origin https://gitlab-ci:${GITLAB_CI_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
+  script:
+    - git tag --force latest
+    - git push --force origin latest
   rules:
     - if: '$CI_COMMIT_TAG =~ /^v\d+(?:\.\d+){0,2}$/'