diff options
author | Roger Gonzalez <roger@rogs.me> | 2023-01-09 19:09:23 -0300 |
---|---|---|
committer | Roger Gonzalez <roger@rogs.me> | 2023-01-09 19:09:23 -0300 |
commit | 1b3b01ca7e2d13eebece22a718810fcd074f5250 (patch) | |
tree | c07a3fde0d6a6809ed9c803f0c15160fb989283d /.gitlab-ci.yml | |
parent | b15ab4adb837e43409e5e3cf3a40a83ef4dbf62f (diff) |
Added .gitlab-ci
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..50f2e6c --- /dev/null +++ b/.gitlab-ci.yml @@ -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 && rm -rf /var/www/yams.media/* && hugo -s . -d /var/www/yams.media/" + only: + - master |