2021-07-04 06:22:25 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
2021-07-04 07:54:30 +00:00
|
|
|
clone:
|
|
|
|
depth: 1
|
|
|
|
|
2021-07-04 06:22:25 +00:00
|
|
|
steps:
|
2021-07-04 06:55:35 +00:00
|
|
|
- name: submodules
|
2021-07-04 06:35:32 +00:00
|
|
|
image: alpine/git
|
|
|
|
commands:
|
|
|
|
- git submodule update --init --recursive
|
|
|
|
|
2021-07-04 06:22:25 +00:00
|
|
|
- name: build
|
|
|
|
image: plugins/hugo
|
|
|
|
settings:
|
|
|
|
hugo_version: 0.84.4
|
|
|
|
validate: true
|
2021-07-04 06:24:48 +00:00
|
|
|
pull: always
|
2021-07-04 06:59:25 +00:00
|
|
|
|
|
|
|
- name: deploy
|
|
|
|
image: alpine
|
|
|
|
volumes:
|
|
|
|
- name: blog-path
|
|
|
|
path: /blog/
|
|
|
|
environment:
|
|
|
|
UID:
|
|
|
|
from_secret: uid
|
|
|
|
GID:
|
|
|
|
from_secret: gid
|
|
|
|
commands:
|
2021-07-04 08:23:45 +00:00
|
|
|
- mv nginx/ public/
|
2021-07-04 07:54:30 +00:00
|
|
|
- chown -R "$UID":"$GID" public/
|
2021-07-04 06:59:25 +00:00
|
|
|
- mv public/ "/blog/${DRONE_COMMIT}"
|
|
|
|
- cd /blog/
|
|
|
|
- rm -f blog.lazkani.io
|
|
|
|
- ln -s "${DRONE_COMMIT}" blog.lazkani.io
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
- name: blog-path
|
|
|
|
host:
|
|
|
|
path: /mnt/blog/
|