wip: autodeploy
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
b56054e83d
commit
3dbd5385d5
|
|
@ -6,5 +6,12 @@ steps:
|
|||
- name: build
|
||||
image: klakegg/hugo
|
||||
commands:
|
||||
- ls
|
||||
- hugo
|
||||
- name: deploy
|
||||
image: instrumentisto/rsync-ssh
|
||||
commands:
|
||||
- bash ./deploy.sh
|
||||
environment:
|
||||
SSH_USER: "www_deploy"
|
||||
SSH_KEY:
|
||||
from_secret: SSH_KEY
|
||||
14
deploy.sh
14
deploy.sh
|
|
@ -1,3 +1,15 @@
|
|||
#!/bin/bash
|
||||
set -ex
|
||||
SSH_ARGS=""
|
||||
[[ -n SSH_KEY ]] && {
|
||||
SSH_KEY_FILE="$(mktemp)"
|
||||
SSH_ARGS="$SSH_ARGS -i $SSH_KEY_FILE"
|
||||
echo "$SSH_KEY" > "$SSH_KEY_FILE"
|
||||
chmod 0600 "$SSH_KEY_FILE"
|
||||
}
|
||||
[[ -n SSH_USER ]] && {
|
||||
SSH_ARGS="$SSH_ARGS -l $SSH_USER"
|
||||
}
|
||||
hugo && rsync -e "ssh $SSH_ARGS" -avz --delete public/ zlomek.irth.pl:/srv/http/homepage/
|
||||
|
||||
hugo && rsync -avz --delete public/ zlomek.irth.pl:/srv/http/homepage/
|
||||
[[ -n "$SSH_KEY_FILE" ]] && rm "$SSH_KEY_FILE"
|
||||
Loading…
Reference in New Issue