Adora Laura Kalb
7caba9b5c5
All checks were successful
ci/woodpecker/push/upload Pipeline was successful
24 lines
769 B
YAML
24 lines
769 B
YAML
when:
|
|
event: push
|
|
branch: main
|
|
|
|
variables:
|
|
- &SSH_PORT '2003'
|
|
|
|
steps:
|
|
upload:
|
|
image: alpine:latest
|
|
secrets:
|
|
- RSYNC_SSHKEY
|
|
- RSYNC_TARGET_SERVER
|
|
- RSYNC_TARGET_USER
|
|
environment:
|
|
TARGET_PATH: /webroot/web-archive.lauka.net
|
|
RSYNC_TARGET_PORT: *SSH_PORT
|
|
commands:
|
|
- apk add --update --no-cache openssh rsync git
|
|
- mkdir -p $HOME/.ssh
|
|
- echo "$RSYNC_SSHKEY" > $HOME/.ssh/id_ed25519
|
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
|
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
|
|
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'
|