Last active
February 11, 2020 09:14
-
-
Save saviour123/d53ef669df732ab22300238a64687ef5 to your computer and use it in GitHub Desktop.
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
image: node:6.4 | |
stages: | |
- build | |
- deploy | |
build site: | |
stage: build | |
script: | |
- npm install --progress=false | |
- npm run build | |
artifacts: | |
expire_in: 1h | |
paths: | |
- dist | |
deploy: | |
image: alpine | |
stage: deploy | |
script: | |
# - apk add --no-cache rsync openssh for alpine image | |
- 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 | |
- rsync -rav --delete dist/ $USER@$SERVER_IP:/var/www/saviourgidi.com | |
- ssh $USER@$SERVER_IP "sudo service nginx reload" | |
only: | |
- gsma_deploy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment