diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 688569403fd1a8fbc8839d792a9b7646575ecd24..d7c8fddebcb14f335c79bb18da55d730e4f59297 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,7 +11,7 @@ pages:
     - apt-get update && apt-get install -y git
     - git config user.name $GITLAB_USER_NAME
     - git config user.email $GITLAB_USER_EMAIL
-    - git fetch origin $PAGES_BRANCH && git checkout -b $PAGES_BRANCH origin/$PAGES_BRANCH || git checkout $PAGES_BRANCH || echo "Pages branch not deployed yet."
+    - git fetch origin $PAGES_BRANCH && git checkout $PAGES_BRANCH || git checkout -b $PAGES_BRANCH origin/$PAGES_BRANCH || echo "Pages branch not deployed yet."
     - git checkout $CI_COMMIT_SHA
   script:
     - >