blog/.drone.yml

77 lines
1.6 KiB
YAML
Raw Normal View History

2020-07-15 00:44:59 +02:00
kind: pipeline
name: default
clone:
disable: true
steps:
- name: clone
image: plugins/git
recursive: true
2020-07-15 17:20:13 +02:00
# Production build and deploy
2020-07-15 00:44:59 +02:00
- name: build
image: klakegg/hugo
commands:
- hugo version
2020-07-15 17:09:03 +02:00
- hugo --minify
2020-07-15 01:36:56 +02:00
environment:
HUGO_ENV: production
2020-07-15 17:20:13 +02:00
when:
branch:
- master
2020-07-15 00:44:59 +02:00
- name: deploy
image: appleboy/drone-scp
settings:
2020-07-15 17:09:03 +02:00
source: public/*
strip_components: 1 # Make sure the tarball doesn't contain leading path
2020-07-15 00:44:59 +02:00
rm: true # Make sure only the newly generated files are left
host:
from_secret: ssh_host
target:
from_secret: ssh_target
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
when:
branch:
- master
2020-07-15 17:20:13 +02:00
# Dev build and deploy
- name: build-dev
image: klakegg/hugo
commands:
- hugo version
# Include drafts and future articles, use dev base url
- hugo --minify -D -F -b https://dev.belanyi.fr
when:
branch:
exclude:
- master
- name: deploy-dev
image: appleboy/drone-scp
settings:
source: public/*
strip_components: 1 # Make sure the tarball doesn't contain leading path
rm: true # Make sure only the newly generated files are left
host:
from_secret: ssh_host
target:
from_secret: ssh_target_dev
username:
from_secret: ssh_user
key:
from_secret: ssh_key
port:
from_secret: ssh_port
when:
branch:
2020-07-15 00:44:59 +02:00
exclude:
2020-07-15 17:20:13 +02:00
- master