ci: use gitlab's review apps (using surge.sh)

Closes #42
This commit is contained in:
Jovan Krunić
2019-04-11 12:01:30 +02:00
parent a503811c1c
commit 83a2c85e05
3 changed files with 327 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ stages:
- build
- test
- docs
- deploy
setup:
image: registry.gitlab.com/openstapps/projectmanagement/builder
@@ -70,3 +71,28 @@ pages:
artifacts:
paths:
- public
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
url: https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
on_stop: stop_review
tags:
- secrecy
stop_review:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- ./node_modules/.bin/surge teardown $CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh
when: manual
environment:
name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME
action: stop
tags:
- secrecy