diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1b564bb3b87bb7760821d252c1724cf6f9820fd2..dabbed2a15bdfd838461ccbf46375f77f1c3e0d4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,7 @@ image: node:12-alpine
 stages:
   - test
   - build
+  - deploy
 
 before_script:
   - npm ci
@@ -34,3 +35,18 @@ frontend-build:
 
   variables:
     API_BASE_URL: /api/v1
+
+deploy-surge:
+  stage: deploy
+
+  # Do not deploy master !
+  except:
+    refs:
+      - master
+
+  before_script:
+    - npm install -g surge
+
+  script:
+    - SLUG=$(echo ${CI_BUILD_REF_NAME} | sed 's/[^a-zA-Z0-9\-_]/-/g ; s/-\+/-/g')
+    - surge dist ${SLUG}-teklia.surge.sh
diff --git a/webpack.config.js b/webpack.config.js
index aeb11a066427057a8562f46bb5dfe38154e91d7e..1cea365f56da70e86c55721d478eb7dc00fd9277 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -12,6 +12,7 @@ const CompressionPlugin = require('compression-webpack-plugin');
 const env = process.env.NODE_ENV || 'development';
 const devMode = env === 'development';
 const { version } = require('./package.json');
+const API_BASE_URL = process.env.API_BASE_URL || '/api/v1';
 
 const config = {
   entry: path.join(__dirname, 'js', 'index.js'),
@@ -143,7 +144,7 @@ const config = {
       },
     }),
     new webpack.EnvironmentPlugin({
-      API_BASE_URL: devMode ? 'http://localhost:8000/api/v1' : '/api/v1',
+      API_BASE_URL: devMode ? 'http://localhost:8000/api/v1' : API_BASE_URL,
       CSRF_COOKIE_NAME: 'arkindex.csrf',
       VERSION: version,
     }),