Created
January 24, 2020 07:56
-
-
Save hcastillaq/ceab93bf79af94e8e58e3845c91f090c to your computer and use it in GitHub Desktop.
ci gitlab basico
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
build: | |
image: node:latest | |
stage: build | |
script: | |
- rm package-lock.json | |
- npm install --progress=false | |
- npm run production --no-progress | |
artifacts: | |
expire_in: 10 mins | |
paths: | |
- public | |
only: | |
refs: | |
- ui | |
deploy: | |
image: alpine | |
stage: deploy | |
script: | |
- apk add --no-cache rsync openssh | |
- mkdir -p ~/.ssh | |
- echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_dsa | |
- chmod 600 ~/.ssh/id_dsa | |
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config | |
- touch hola.txt | |
- echo $SSH_PORT | |
- rsync -rav -e "ssh -p $SSH_PORT" --progress --delete public/ $SSH_HOST:$PUBLIC_PATH | |
only: | |
refs: | |
- ui |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment