pizzawednes.day/.drone.yml

37 lines
694 B
YAML

kind: pipeline
name: default
steps:
- name: build
image: ghcr.io/getzola/zola:v0.17.2
entrypoint: ["/bin/zola"]
command: ["build"]
- name: deploy
image: ubuntu
environment:
HOST:
from_secret: host
USER:
from_secret: user
SSH_KEY:
from_secret: ssh_key
PATH:
from_secret: path
when:
branch:
- main
commands:
- apt-get update -qq > /dev/null
- apt-get install ssh rsync -qq > /dev/null
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$RSYNC_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rsync -rP public/ "$${USER}@$${HOST}:$${PATH}"