website/.woodpecker/deploy.yml

48 lines
1.4 KiB
YAML
Raw Normal View History

2023-07-31 15:51:56 +02:00
steps:
build:
2024-04-23 22:21:57 +02:00
image: golang:1.22-bookworm
2023-08-08 09:27:53 +02:00
environment:
2024-04-23 22:21:57 +02:00
- HUGO_VERSION=0.123.4
- TZ=Europe/Berlin
2023-07-31 15:51:56 +02:00
when:
2024-04-23 22:21:57 +02:00
- event: push
branch: [main, staging]
2023-08-08 09:27:53 +02:00
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
2023-07-31 15:51:56 +02:00
2024-04-23 22:21:57 +02:00
upload:
image: alpine:latest
2023-08-01 09:10:15 +02:00
secrets:
2024-04-23 22:21:57 +02:00
- RSYNC_SSHKEY
- RSYNC_TARGET_SERVER
- RSYNC_TARGET_USER
environment:
- TARGET_PATH=/webroot/adora.codes
when:
- event: push
branch: main
2023-08-01 09:10:15 +02:00
commands:
2024-04-23 22:21:57 +02:00
- 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