samsapti.dev/.drone.yml

37 lines
820 B
YAML
Raw Normal View History

2022-05-23 22:21:41 +00:00
kind: pipeline
type: docker
name: build-and-deploy
steps:
- name: build
image: klakegg/hugo:latest
volumes:
- name: build
2022-05-23 22:23:20 +00:00
path: $HOME/build
2022-05-23 22:21:41 +00:00
commands:
- hugo
2022-05-23 22:23:20 +00:00
- cp -rv public $HOME/build
2022-05-23 22:21:41 +00:00
- name: deploy
image: alpine/git:latest
volumes:
- name: build
2022-05-23 22:23:20 +00:00
path: $HOME/build
2022-05-23 22:21:41 +00:00
environment:
SSH_USER:
from_secret: ssh_user
SSH_HOST:
from_secret: ssh_host
SSH_PORT:
from_secret: ssh_port
SSH_KEY:
from_secret: ssh_key
commands:
- mkdir $HOME/.ssh
- echo "$SSH_KEY" > $HOME/.ssh/id_ed25519
2022-05-23 22:23:20 +00:00
- chmod 600 $HOME/.ssh/id_ed25519
- scp -o "StrictHostKeyChecking no" -P ${SSH_PORT} -r $HOME/build/public ${SSH_USER}@${SSH_HOST}:docker/nginx/website
2022-05-23 22:21:41 +00:00
volumes:
- name: build
temp: {}