diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 62f2a6bb08138a6b32449b77dd23e7c8f7556987..0a37a1326e04c2637132ee8118705cf0d6856d5d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ variables:
 build:
   stage: build
   script:
+    - CI=true
     - npm install
     - gatsby build --prefix-paths
   artifacts:
diff --git a/gatsby-config.js b/gatsby-config.js
index 24d090971f00e972874df8322a36354a6efebb1e..cd327a8a4f1531070be91efc1b493a6aa1fff17e 100644
--- a/gatsby-config.js
+++ b/gatsby-config.js
@@ -1,5 +1,5 @@
 module.exports = {
-  pathPrefix:`.env.${process.env.CI_PAGES_URL}`,
+  pathPrefix: "${CI_PAGES_URL}",
   siteMetadata: {
     title: `Gatsby Default Starter`,
     description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,