samsapti.dev/.drone.yml
Sam A. 37b651e65c
All checks were successful
continuous-integration/drone/push Build is passing
CI: Install py3-pygments
2022-11-20 19:40:15 +01:00

40 lines
1,014 B
YAML

kind: pipeline
type: docker
name: build-and-deploy
steps:
- name: build
image: klakegg/hugo:ext-alpine
environment:
HUGO_SECURITY_HTTP_URLS: none
commands:
- apk add --no-cache git py3-pygments
- git submodule update --init --single-branch --depth=1
- hugo
- name: deploy
image: alpine/git:latest
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 ~/.ssh
- echo "$${SSH_KEY}" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh -o "StrictHostKeyChecking no" -p $${SSH_PORT}
$${SSH_USER}@$${SSH_HOST} "rm -rf docker/nginx/website/public/*"
- scp -o "StrictHostKeyChecking no" -P $${SSH_PORT} -r
./public $${SSH_USER}@$${SSH_HOST}:docker/nginx/website
when:
branch:
- main
event:
exclude:
- pull_request