add rsync ci target
All checks were successful
ci/woodpecker/push/deploy-rsync Pipeline was successful
ci/woodpecker/push/deploy-netlify Pipeline was successful
ci/woodpecker/push/deploy-cloudflare Pipeline was successful

This commit is contained in:
Adora Laura Kalb 2024-02-29 11:23:07 +01:00
parent 0a989240c7
commit 100edcede0
Signed by: adoralaura
GPG key ID: 7A4552166FC8C056

View file

@ -0,0 +1,47 @@
steps:
build:
image: golang:1.21-bookworm
environment:
- HUGO_VERSION=0.123.4
- 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/adora.codes
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
- ssh-keyscan -t ed25519 $RSYNC_TARGET_SERVER >> $HOME/.ssh/known_hosts
- rsync -avh --delete ./public/ $RSYNC_TARGET_USER@$RSYNC_TARGET_SERVER:$TARGET_PATH
#deploy-production:
# # image: node:alpine
# image: lauralani/netlify-cli:latest
# pull: true
# when:
# - event: push
# branch: main
# secrets:
# - NETLIFY_AUTH_TOKEN
# - NETLIFY_SITE_ID
# commands:
# # - npm install netlify-cli -g
# - netlify deploy --prod --dir ./public