Created
December 26, 2019 10:34
-
-
Save peschee/aa574d9516cf098743397d9fd4a43138 to your computer and use it in GitHub Desktop.
Gitlab CI Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stages: | |
- build | |
- deploy | |
build: | |
stage: build | |
image: node:dubnium | |
variables: | |
CI: "true" | |
script: | |
- npm i | |
- npm run build -- --output-path dist --configuration develop --base-href /app/$APP_NAME-$CI_COMMIT_REF_SLUG/ | |
artifacts: | |
paths: | |
- dist/ | |
expire_in: '1 hour' | |
cache: | |
paths: | |
- node_modules/ | |
only: | |
- develop | |
- /^feature\/.*$/ | |
- /^hotfix\/.*$/ | |
tags: | |
- docker | |
deploy: | |
stage: deploy | |
dependencies: | |
- build | |
artifacts: | |
paths: | |
- dist/ | |
script: | |
- docker-compose -p $APP_NAME-$CI_COMMIT_REF_SLUG up -d --build | |
environment: | |
name: review/$CI_COMMIT_REF_NAME | |
on_stop: undeploy | |
only: | |
- develop | |
- /^feature\/.*$/ | |
- /^hotfix\/.*$/ | |
tags: | |
- deploy | |
undeploy: | |
stage: deploy | |
script: | |
- docker-compose -p $APP_NAME-$CI_COMMIT_REF_SLUG down | |
environment: | |
name: review/$CI_COMMIT_REF_NAME | |
action: stop | |
when: manual | |
only: | |
- /^feature\/.*$/ | |
- /^hotfix\/.*$/ | |
tags: | |
- deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment