pizzawednes.day/.drone.yml

38 lines
694 B
YAML
Raw Normal View History

2023-08-19 20:25:29 +02:00
kind: pipeline
2023-08-19 20:45:06 +02:00
type: docker
name: deploy
2023-08-19 20:25:29 +02:00
steps:
2023-08-19 22:08:27 +02:00
- name: build
image: ghcr.io/getzola/zola:v0.17.2
entrypoint: ["/bin/zola"]
command: ["build"]
2023-08-19 21:58:38 +02:00
- name: deploy
2023-08-19 22:14:04 +02:00
image: ubuntu:latest
2023-08-19 22:09:16 +02:00
2023-08-19 20:25:29 +02:00
environment:
2023-08-19 20:37:37 +02:00
HOST:
from_secret: host
USER:
from_secret: user
SSH_KEY:
2023-08-19 22:11:06 +02:00
from_secret: rsync_key
2023-08-19 22:08:27 +02:00
SITE_PATH:
2023-08-19 20:37:37 +02:00
from_secret: path
2023-08-19 22:09:16 +02:00
2023-08-19 20:37:37 +02:00
when:
branch:
- main
2023-08-19 22:09:16 +02:00
2023-08-19 20:37:37 +02:00
commands:
2023-08-19 22:14:04 +02:00
- apt-get update
- apt-get install -y ssh rsync
2023-08-19 22:09:16 +02:00
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
2023-08-19 22:11:06 +02:00
- echo "$SSH_KEY" > ~/.ssh/id_rsa
2023-08-19 22:09:16 +02:00
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
2023-08-19 22:09:37 +02:00
- rsync -rP public/ "$${USER}@$${HOST}:$${SITE_PATH}"