Add deployment via GitLab CI

master
Tomáš Mládek 2021-01-10 12:35:05 +01:00
parent 18e43839d1
commit 982f1ef026
1 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,7 @@
stages:
- build
- deploy
build site:
image: node:lts
stage: build
@ -8,3 +12,14 @@ build site:
artifacts:
paths:
- app/dist
deploy site:
image: instrumentisto/rsync-ssh
stage: deploy
script:
- mkdir ~/.ssh
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- rsync -vr -e "ssh -p ${SSH_PORT}" app/dist/ "${DEPLOY_DEST}"