pizzawednes.day/.drone.yml

35 lines
596 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
image: alpine: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
USER:
from_secret: user
SSH_KEY:
from_secret: ssh_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:
- apk update
- apk add openssh rsync
2023-08-19 22:09:16 +02:00
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
2023-08-19 22:28:08 +02:00
- echo "$SSH_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
2023-08-19 22:09:16 +02:00
- ssh-add
2023-08-19 22:33:57 +02:00
- rsync -rP public/ "$${USER}@pizzawednes.day:$${SITE_PATH}"