21 lines
609 B
YAML
21 lines
609 B
YAML
|
when:
|
||
|
event: push
|
||
|
branch: main
|
||
|
|
||
|
steps:
|
||
|
upload:
|
||
|
image: alpine:latest
|
||
|
secrets:
|
||
|
- SSH_KEY
|
||
|
- TARGET_SERVER
|
||
|
- TARGET_USER
|
||
|
environment:
|
||
|
- TARGET_PATH=/webroot/web-archive.lauka.net
|
||
|
commands:
|
||
|
- apk add --update --no-cache openssh rsync git
|
||
|
- mkdir -p $HOME/.ssh
|
||
|
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
|
||
|
- chmod 0600 $HOME/.ssh/id_ed25519
|
||
|
- ssh-keyscan -t ed25519 $TARGET_SERVER >> $HOME/.ssh/known_hosts
|
||
|
- rsync -avh --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH --exclude 'readme.md' --exclude '.woodpecker' --exclude '.git'
|