pizzawednes.day/.drone.yml

35 lines
633 B
YAML

kind: pipeline
type: docker
name: deploy
steps:
- name: build
image: ghcr.io/getzola/zola:v0.17.2
entrypoint: ["/bin/zola"]
command: ["build"]
- name: deploy
image: alpine:latest
environment:
USER:
from_secret: user
SSH_KEY:
from_secret: ssh_key
SITE_PATH:
from_secret: path
when:
branch:
- main
commands:
- apk update
- apk add openssh rsync
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$SSH_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh-add
- rsync -e "ssh -o StrictHostKeyChecking=no" -rP public/ "$${USER}@pizzawednes.day:$${SITE_PATH}"