Last active
September 17, 2021 10:34
-
-
Save yaapis/3107528442df931e19a41cf8ee9b2f89 to your computer and use it in GitHub Desktop.
Gitlab CI config file for deploy via SSH
This file contains hidden or 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
before_script: | |
- npm -v | |
stages: | |
- setup | |
- codestyle | |
- build | |
- test | |
- deploy | |
Setup: | |
stage: setup | |
script: | |
- npm install --progress=false | |
cache: | |
key: ${CI_BUILD_REF_NAME} | |
paths: | |
- node_modules/ | |
artifacts: | |
paths: | |
- node_modules/ | |
CodeStyle: | |
stage: codestyle | |
script: | |
- ./node_modules/.bin/eslint src | |
Build: | |
stage: build | |
script: | |
- ./node_modules/.bin/gulp build | |
artifacts: | |
paths: | |
- build/ | |
only: | |
- master | |
Testing: | |
stage: test | |
script: | |
- echo "Testing..." | |
#- npm test | |
only: | |
- master | |
Deploy: | |
stage: deploy | |
script: | |
- eval $(ssh-agent -s) | |
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - | |
- rsync -avuz --delete --exclude=_ -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress $CI_PROJECT_DIR/build/ $DEPLOY_USER@$DEPLOY_SERVER:$DEPLOY_PATH | |
only: | |
- master |
This file contains hidden or 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
{ | |
"name": "", | |
"version": "", | |
"description": "", | |
"main": "", | |
"license": "MIT", | |
"dependencies": { | |
"gulp": "^3.9.1" | |
}, | |
"devDependencies": { | |
"eslint": "^4.0.0", | |
"eslint-config-standard": "^10.2.1", | |
"eslint-plugin-import": "^2.3.0", | |
"eslint-plugin-node": "^5.0.0", | |
"eslint-plugin-promise": "^3.5.0", | |
"eslint-plugin-standard": "^3.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment