This commit is contained in:
parent
9ac12f7c39
commit
7caba9b5c5
2 changed files with 198 additions and 7 deletions
|
@ -2,19 +2,23 @@ when:
|
||||||
event: push
|
event: push
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
|
variables:
|
||||||
|
- &SSH_PORT '2003'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
upload:
|
upload:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
secrets:
|
secrets:
|
||||||
- SSH_KEY
|
- RSYNC_SSHKEY
|
||||||
- TARGET_SERVER
|
- RSYNC_TARGET_SERVER
|
||||||
- TARGET_USER
|
- RSYNC_TARGET_USER
|
||||||
environment:
|
environment:
|
||||||
- TARGET_PATH=/webroot/web-archive.lauka.net
|
TARGET_PATH: /webroot/web-archive.lauka.net
|
||||||
|
RSYNC_TARGET_PORT: *SSH_PORT
|
||||||
commands:
|
commands:
|
||||||
- apk add --update --no-cache openssh rsync git
|
- apk add --update --no-cache openssh rsync git
|
||||||
- mkdir -p $HOME/.ssh
|
- mkdir -p $HOME/.ssh
|
||||||
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
|
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
||||||
- chmod 0600 $HOME/.ssh/id_ed25519
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
||||||
- ssh-keyscan -t ed25519 $TARGET_SERVER >> $HOME/.ssh/known_hosts
|
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
||||||
- rsync -avh --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'
|
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue