diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f055338764e2b6e428a6776c87b0d9ac98f7324..a3fb9a6d832f4387b43747d5db8722ae385e2207 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -39,8 +39,8 @@ build-job-Z2:       # This job runs in the build stage, which runs first.
   stage: build
   script:
     # move to fpga_imp directory and run the fpga build script for pynq z2
-    - source set_env.sh
     - git pull --recurse-submodules
+    - source set_env.sh
     - cd ./nanosoc_tech/fpga/
     - make build_fpga FPGA=z2
     - FILE=../imp/fpga/output/pynq_z2/overlays/nanosoc_design.bit 
@@ -62,8 +62,8 @@ build-job-ZCU104:       # This job runs in the build stage, which runs first.
   stage: build
   script:
    # move to fpga_imp directory and run the fpga build script for pynq z2 
-    - source set_env.sh
     - git pull --recurse-submodules
+    - source set_env.sh
     - cd ./nanosoc_tech/fpga
     - make build_fpga FPGA=zcu104
     - FILE=../imp/fpga/output/pynq_zcu104/overlays/nanosoc_design.bit