Skip to content
Snippets Groups Projects
Commit 6c2aa6b9 authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Use GitLab CI environments for Surge

parent 86fe9a1c
No related branches found
No related tags found
No related merge requests found
......@@ -69,9 +69,32 @@ deploy-surge:
only:
- merge_requests
environment:
name: ${CI_COMMIT_REF_SLUG}
url: https://${CI_COMMIT_REF_SLUG}-teklia.surge.sh
on_stop: stop-surge
before_script:
- npm install -g surge
script:
- surge dist ${CI_ENVIRONMENT_URL}
stop-surge:
stage: deploy
when: manual
# Do not try to checkout the branch if it was deleted
variables:
GIT_STRATEGY: none
environment:
name: ${CI_COMMIT_REF_SLUG}
url: https://${CI_COMMIT_REF_SLUG}-teklia.surge.sh
action: stop
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
- surge teardown ${CI_ENVIRONMENT_URL}
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