Skip to content

Instantly share code, notes, and snippets.

@saviour123
Last active February 11, 2020 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saviour123/d53ef669df732ab22300238a64687ef5 to your computer and use it in GitHub Desktop.
Save saviour123/d53ef669df732ab22300238a64687ef5 to your computer and use it in GitHub Desktop.
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