From 66b23ebdea480860737b7a344a00fc10cf7a916f Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 18 Apr 2021 15:00:26 -0500 Subject: [PATCH] Use promotions and hugo plugin --- .drone.yml | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.drone.yml b/.drone.yml index b832043..ef60231 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,28 +1,49 @@ +--- +kind: pipeline +type: docker +name: Build and validate + +trigger: + event: + - push + - pull_request + +steps: + - name: submodules + image: alpine/git + commands: + - git submodule update --init --recursive + + - name: build + image: plugins/hugo + settings: + hugo_version: 0.82 + validate: true + --- kind: pipeline type: docker name: Deploy to bbaovanc.com trigger: - branch: - - master event: - exclude: - - pull_request + - promote + target: + - production steps: - - name: Update submodules + - name: submodules image: alpine/git commands: - git submodule update --init --recursive - - name: Build site - image: mapitman/docker-hugo - commands: - - hugo version - - hugo --minify + - name: build + image: plugins/hugo + settings: + hugo_version: 0.82 + validate: true - - name: Upload files + - name: deploy image: appleboy/drone-scp settings: host: bbaovanc.com @@ -30,7 +51,8 @@ steps: username: droneci key: from_secret: SSH_KEY - target: /var/www/bbaovanc/blog/ + target: /tmp/blog/ + #target: /var/www/bbaovanc/blog/ rm: true source: public/ strip_components: 1