Use promotions and hugo plugin
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
BBaoVanC 2021-04-18 15:00:26 -05:00
parent adf52c8498
commit 66b23ebdea
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A

View File

@ -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 kind: pipeline
type: docker type: docker
name: Deploy to bbaovanc.com name: Deploy to bbaovanc.com
trigger: trigger:
branch:
- master
event: event:
exclude: - promote
- pull_request target:
- production
steps: steps:
- name: Update submodules - name: submodules
image: alpine/git image: alpine/git
commands: commands:
- git submodule update --init --recursive - git submodule update --init --recursive
- name: Build site - name: build
image: mapitman/docker-hugo image: plugins/hugo
commands: settings:
- hugo version hugo_version: 0.82
- hugo --minify validate: true
- name: Upload files - name: deploy
image: appleboy/drone-scp image: appleboy/drone-scp
settings: settings:
host: bbaovanc.com host: bbaovanc.com
@ -30,7 +51,8 @@ steps:
username: droneci username: droneci
key: key:
from_secret: SSH_KEY from_secret: SSH_KEY
target: /var/www/bbaovanc/blog/ target: /tmp/blog/
#target: /var/www/bbaovanc/blog/
rm: true rm: true
source: public/ source: public/
strip_components: 1 strip_components: 1