|
|
|
kind: pipeline
|
|
|
|
name: blog
|
|
|
|
type: docker
|
|
|
|
|
|
|
|
clone:
|
|
|
|
depth: 1
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: hugo
|
|
|
|
image: code.ndumas.com/ndumas/hugo:latest
|
|
|
|
commands:
|
|
|
|
- ls -lah $DRONE_WORKSPACE/hugo_cache/
|
|
|
|
- HUGO_CACHEDIR="/$DRONE_WORKSPACE/hugo_cache/" sh $DRONE_WORKSPACE/build.sh $DRONE_BRANCH
|
|
|
|
volumes:
|
|
|
|
- name: go_module_cache
|
|
|
|
path: /drone/src/hugo_cache/
|
|
|
|
- name: publish_prod
|
|
|
|
depends_on:
|
|
|
|
- hugo
|
|
|
|
image: drillster/drone-rsync
|
|
|
|
settings:
|
|
|
|
key:
|
|
|
|
from_secret: BLOG_DEPLOY_KEY
|
|
|
|
user: blog
|
|
|
|
delete: true
|
|
|
|
recursive: true
|
|
|
|
hosts: ["blog.ndumas.com"]
|
|
|
|
source: /drone/src/public/
|
|
|
|
target: /var/www/blog.ndumas.com/
|
|
|
|
include: ["*"]
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- main
|
|
|
|
- name: publish_dev
|
|
|
|
depends_on:
|
|
|
|
- hugo
|
|
|
|
image: drillster/drone-rsync
|
|
|
|
settings:
|
|
|
|
key:
|
|
|
|
from_secret: BLOG_DEPLOY_KEY
|
|
|
|
user: blog
|
|
|
|
delete: true
|
|
|
|
recursive: true
|
|
|
|
hosts: ["blog.ndumas.com"]
|
|
|
|
source: /drone/src/public/
|
|
|
|
target: /var/www/dev.blog.ndumas.com/
|
|
|
|
include: ["*"]
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- dev
|
|
|
|
- name: publish_drafts
|
|
|
|
depends_on:
|
|
|
|
- hugo
|
|
|
|
image: drillster/drone-rsync
|
|
|
|
settings:
|
|
|
|
key:
|
|
|
|
from_secret: BLOG_DEPLOY_KEY
|
|
|
|
user: blog
|
|
|
|
delete: true
|
|
|
|
recursive: true
|
|
|
|
hosts: ["blog.ndumas.com"]
|
|
|
|
source: /drone/src/public/
|
|
|
|
target: /var/www/drafts.blog.ndumas.com/
|
|
|
|
include: ["*"]
|
|
|
|
when:
|
|
|
|
branch:
|
|
|
|
include:
|
|
|
|
- drafts
|
|
|
|
volumes:
|
|
|
|
- name: go_module_cache
|
|
|
|
host:
|
|
|
|
path: /var/cache/go/hugo_cache/
|