Skip to content

Instantly share code, notes, and snippets.

@wingsuitist
Last active November 17, 2017 02:32
Show Gist options
  • Save wingsuitist/96971bfc91ec06a7a4d2bd843e7c8cf9 to your computer and use it in GitHub Desktop.
Save wingsuitist/96971bfc91ec06a7a4d2bd843e7c8cf9 to your computer and use it in GitHub Desktop.
gitlab-ci stage and prod separated
image: trion/ng-cli-karma
cache:
paths:
- node_modules/
deploy_stage:
stage: deploy
environment: Stage
only:
- master
script:
- rm ./package-lock.json
- npm install
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false
- ./node_modules/@angular/cli/bin/ng build --progress false --prod --base-href plus1-stage.surge.sh
- ./node_modules/.bin/surge -p dist/ --domain plus1-stage.surge.sh
deploy_production:
stage: deploy
environment: Production
only:
- tags
script:
- rm ./package-lock.json
- npm install
- ./node_modules/@angular/cli/bin/ng test --progress false --single-run=true --watch=false
- ./node_modules/@angular/cli/bin/ng e2e --progress false --watch=false
- ./node_modules/@angular/cli/bin/ng build --progress false --prod --base-href plus1.surge.sh
- ./node_modules/.bin/surge -p dist/ --domain plus1.surge.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment