blog/.drone.yml

37 lines
1.2 KiB
YAML
Raw Normal View History

2020-01-05 11:59:08 +00:00
kind: pipeline
type: docker
2020-01-19 04:36:24 +00:00
name: default
2020-01-05 11:59:08 +00:00
steps:
2020-01-05 12:18:51 +00:00
- name: Modify-Amazon-Links
2020-01-05 11:59:08 +00:00
image: cibuilds/hugo:0.62.1
commands:
2020-01-05 12:19:29 +00:00
- grep -l -r ecx.images-amazon.com content/ | sort | uniq | xargs -t --no-run-if-empty sed -ie "s/http:\/\/ecx.images-amazon.com/https:\/\/images-na.ssl-images-amazon.com/g"
2020-01-05 11:59:08 +00:00
- grep -l -r "http://www.amazon.co.jp/exec" content/ | sort | uniq | xargs -t --no-run-if-empty sed -i -e "s/http:\/ / www.amazon.co.jp\/exec/https:\/ / www.amazon.co.jp\/exec/g"
2020-01-19 04:19:39 +00:00
- name: hugo
image: cibuilds/hugo:0.62.1
commands:
2020-01-19 04:36:24 +00:00
- if [ "${DRONE_BRANCH}" != "master" ]; then hugo -e staging -v -s .; else hugo -e production -v -s .; fi
2020-01-19 04:19:39 +00:00
2020-01-05 12:22:05 +00:00
- name: Compress-the-Assets
image: cibuilds/hugo:0.62.1
2020-01-05 12:51:36 +00:00
commands:
2020-01-05 12:53:45 +00:00
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do gzip -c ${TARGET} > ${TARGET}.gz; done
2020-01-19 04:43:44 +00:00
- for TARGET in `find public/ -type f | egrep "\.(css|js|png|jpg|JPG|PNG|CSS|JS)$"`; do rm -f ${TARGET}; done
2020-01-19 04:19:39 +00:00
2020-01-19 04:37:58 +00:00
- name: scp
image: appleboy/drone-scp
settings:
host: 10.0.1.166
username: webadm
port: 10022
target: /var/www/blog
source: public/
key:
from_secret: ssh_key
2020-01-05 12:22:05 +00:00
2020-01-19 04:36:24 +00:00
trigger:
event:
- push