Added Gitlab CI

This commit is contained in:
Roger Gonzalez 2023-05-13 21:36:22 -03:00
parent 00a545fdc2
commit 506c379e2e
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

16
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,16 @@
image: alpine:latest
deploy:
stage: deploy
before_script:
- 'command -v ssh-agent >/dev/null || ( apk add --update openssh )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "cd repo && git stash && git pull --force origin master && pip install -r requirements.txt && systemctl restart theinfinitewebsite"
only:
- master