new drone integration

This commit is contained in:
Aleksander Cynarski 2020-08-31 18:36:53 +02:00
parent f45fa97f51
commit 2bbdbaece5

View File

@ -1,32 +1,39 @@
---
kind: pipeline
type: docker
name: default
trigger:
branch:
- master
steps:
- name: build
image: plugins/hugo
settings:
pull: always
url:
from_secret: domain
validate: true
- name: Version check
image: paramah/hugo-deploy
commands:
- echo ">>> HUGO version check"
- hugo version
- name: deploy
image: appleboy/drone-scp
settings:
host:
from_secret: ssh_host
target:
from_secret: site_path
source: public/*
username:
from_secret: ssh_username
password:
from_secret: ssh_password
port:
from_secret: ssh_port
when:
branch:
- master
event:
exclude:
- pull_request
- name: Build
image: paramah/hugo-deploy
commands:
- npm install -D --save autoprefixer
- npm install -D --save postcss-cli
- git submodule update --init --recursive
- hugo --destination /drone/src/build
- minify -r -o /drone/src/build /drone/src/build
- name: Upload
image: paramah/hugo-deploy
commands:
- eval `ssh-agent -s`
- echo "$SSH_KEY" | ssh-add -
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rsync -rv -e "ssh -p 65522" /drone/src/build/ $SSH_URI:$DEST --checksum
environment:
SSH_KEY:
from_secret: drone_ssh_key
SSH_URI:
from_secret: ssh_uri
DEST:
from_secret: destination