Skip to content
Snippets Groups Projects
Commit fd31ecf7 authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Surge support

parent c72f9c13
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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,
}),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment