www-lauka-net-11ty/.woodpecker/deploy.yaml

52 lines
1.4 KiB
YAML
Raw Normal View History

2023-06-13 11:27:58 +02:00
steps:
build:
image: node:19
when:
- event: push
branch: [main, staging]
commands:
- npm install -D @11ty/eleventy
2023-06-14 11:06:43 +02:00
- rm -rf public/
2023-06-13 11:27:58 +02:00
- npx @11ty/eleventy --input=. --output=public
deploy-stage:
image: alpine:latest
when:
- event: push
branch: staging
secrets:
- SSH_KEY
environment:
- TARGET_SERVER=cloud.lauka.net
- TARGET_USER=webadmin
- TARGET_PATH=/webroot/www.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
- cd public/
2023-06-14 11:06:43 +02:00
- rsync -avh --checksum --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH
2023-06-13 11:27:58 +02:00
deploy-prod:
image: alpine:latest
when:
- event: push
branch: main
secrets:
- SSH_KEY
environment:
- TARGET_SERVER=cloud.lauka.net
- TARGET_USER=webadmin
- TARGET_PATH=/webroot/staging-www.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
- cd public/
2023-06-14 11:06:43 +02:00
- rsync -avh --checksum --delete ./ $TARGET_USER@$TARGET_SERVER:$TARGET_PATH