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
|
2021-09-17 19:15:35 +00:00
|
|
|
image: docker:dind
|
2021-07-04 06:59:25 +00:00
|
|
|
volumes:
|
2021-09-17 19:15:35 +00:00
|
|
|
- name: docker-socket
|
|
|
|
path: /var/run/docker.sock
|
2021-07-04 06:59:25 +00:00
|
|
|
- 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 08:34:04 +00:00
|
|
|
- rm -rf public/images/*
|
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
|
2021-09-17 19:15:35 +00:00
|
|
|
- docker restart nginx
|
2021-07-04 06:59:25 +00:00
|
|
|
|
|
|
|
volumes:
|
2021-09-17 19:15:35 +00:00
|
|
|
- name: docker-socket
|
|
|
|
host:
|
|
|
|
path: /var/run/docker.sock
|
2021-07-04 06:59:25 +00:00
|
|
|
- name: blog-path
|
|
|
|
host:
|
|
|
|
path: /mnt/blog/
|