From cd646a27954f5dac0934f22d679159ee568c1da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Fri, 31 May 2019 14:12:11 +0200 Subject: [PATCH] ci: add staging and production environments Closes #58 --- .gitlab-ci.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0a3ec554..c61131fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,8 +36,7 @@ setup: build: stage: build script: - - npm install - - npm run build + - npm run build:prod artifacts: paths: - www @@ -84,7 +83,6 @@ pages: review: stage: deploy script: - - npm run build:prod - ./node_modules/.bin/surge -p ./www -d https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/ environment: name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME @@ -105,3 +103,27 @@ stop_review: action: stop tags: - secrecy + +staging: + stage: deploy + script: + - ./node_modules/.bin/surge -p ./www -d https://$CI_PROJECT_PATH_SLUG-staging.surge.sh/ + environment: + name: staging + url: https://$CI_PROJECT_PATH_SLUG-staging.surge.sh/ + only: + - develop + tags: + - secrecy + +production_demo: + stage: deploy + script: + - ./node_modules/.bin/surge -p ./www -d https://$CI_PROJECT_PATH_SLUG.surge.sh/ + environment: + name: production + url: https://$CI_PROJECT_PATH_SLUG.surge.sh/ + only: + - master + tags: + - secrecy