The DevOps Blog https://blog.lazkani.io
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
883 B

---
kind: pipeline
name: default
clone:
depth: 1
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
- name: build
image: plugins/hugo
settings:
hugo_version: 0.84.4
validate: true
pull: always
- name: deploy
image: docker:dind
volumes:
- name: docker-socket
path: /var/run/docker.sock
- name: blog-path
path: /blog/
environment:
UID:
from_secret: uid
GID:
from_secret: gid
commands:
- mv nginx/ public/
- rm -rf public/images/*
- chown -R "$UID":"$GID" public/
- mv public/ "/blog/${DRONE_COMMIT}"
- cd /blog/
- rm -f blog.lazkani.io
- ln -s "${DRONE_COMMIT}" blog.lazkani.io
- docker restart nginx
volumes:
- name: docker-socket
host:
path: /var/run/docker.sock
- name: blog-path
host:
path: /mnt/blog/