This repository has been archived on 2024-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
certwarden-deploy-docs/.woodpecker/deploy-rsync.yml

33 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-04 11:02:55 +02:00
steps:
build:
2024-07-04 11:04:14 +02:00
image: golang:1.22-bookworm
2024-07-04 11:02:55 +02:00
environment:
2024-07-04 11:04:14 +02:00
- HUGO_VERSION=0.128.1
2024-07-04 11:02:55 +02:00
- TZ=Europe/Berlin
when:
- event: push
branch: [main, staging]
commands:
- wget https://github.com/gohugoio/hugo/releases/download/v$${HUGO_VERSION}/hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && apt install ./hugo_extended_$${HUGO_VERSION}_linux-amd64.deb && rm -f hugo_extended_$${HUGO_VERSION}_linux-amd64.deb
- hugo --minify --destination ./public
upload:
image: alpine:latest
secrets:
- RSYNC_SSHKEY
- RSYNC_TARGET_SERVER
- RSYNC_TARGET_USER
environment:
- TARGET_PATH=/webroot/certwarden-deploy.adora.codes
2024-07-12 12:49:57 +02:00
- RSYNC_TARGET_PORT=2003
2024-07-04 11:02:55 +02:00
when:
- event: push
branch: main
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
2024-07-12 12:49:57 +02:00
- ssh-keyscan -t ed25519 -p $RSYNC_TARGET_PORT $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
2024-07-12 12:52:10 +02:00
- rsync -avh -e "ssh -p $RSYNC_TARGET_PORT" --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH