fmartingr.com/.woodpecker/deploy.yml
Felipe M. a5c1479549
All checks were successful
ci/woodpecker/push/deploy Pipeline was successful
ci/woodpecker/cron/deploy Pipeline was successful
ci: daily builds for scheduled posts
2024-11-26 08:51:09 +01:00

33 lines
849 B
YAML

when:
- event: push
branch: master
- event: cron
branch: master
cron: Daily build
steps:
- name: Hugo build
image: alpine:latest
commands:
- apk add --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community go hugo git
- hugo --gc --minify
- ls public
- name: Deploy
image: alpine:latest
environment:
SSH_HOST:
from_secret: SSH_HOST
SSH_USER:
from_secret: SSH_USER
SSH_PATH:
from_secret: SSH_PATH
SSH_PRIVATE_KEY:
from_secret: SSH_PRIVATE_KEY
commands:
- apk add --no-cache openssh-client rsync
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-keyscan $SSH_HOST >> ~/.ssh/known_hosts
- rsync -avz public/ $SSH_USER@$SSH_HOST:$SSH_PATH