diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65ffc8a58bac592a7bc89044b6f437627ae36851..092fd8b7e0396665152a54f2ea10a64a715bbc4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,6 @@ +variables: + BUILD_DIR: dist + stages: - test - build @@ -19,3 +22,31 @@ tslint: - npm install rxjs - node_modules/tslint/bin/tslint -p ./tsconfig.json -c ./tslint.json ./src/**/*.ts +ngbuild: + stage: build + tags: + - nodejs + allow_failure: false + dependencies: [] + script: + - npm install + - ng build --prod + artifacts: + paths: + - "$BUILD_DIR" + +deploy: + stage: deploy + only: + - master + tags: + - ssh + dependencies: + - tslint + - build + script: + - eval $(ssh-agent -s) + - mkdir ~/.ssh #&& echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - ssh-keyscan "$SERVER_URL" >> ~/.ssh/known_hosts + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - scp -r "$BUILD_DIR"* "$SSH_URL"