blog.lazkani.io/.drone.yml

50 lines
883 B
YAML
Raw Normal View History

2021-07-04 06:22:25 +00:00
---
kind: pipeline
name: default
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
pull: always
2021-07-04 06:59:25 +00:00
- name: deploy
image: docker:dind
2021-07-04 06:59:25 +00:00
volumes:
- 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:
- mv nginx/ public/
2021-07-04 08:34:04 +00:00
- rm -rf public/images/*
- 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
- docker restart nginx
2021-07-04 06:59:25 +00:00
volumes:
- name: docker-socket
host:
path: /var/run/docker.sock
2021-07-04 06:59:25 +00:00
- name: blog-path
host:
path: /mnt/blog/