blog/.drone.yml

121 lines
3.4 KiB
YAML
Raw Normal View History

2020-01-05 11:59:08 +00:00
kind: pipeline
type: docker
2020-01-19 06:37:17 +00:00
name: production
2020-01-05 11:59:08 +00:00
steps:
2020-01-05 12:18:51 +00:00
- name: Modify-Amazon-Links
2020-02-16 15:08:57 +00:00
image: alpine:3.9
2020-01-05 11:59:08 +00:00
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"
- 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-05 11:59:08 +00:00
2021-05-06 13:48:30 +00:00
- name: generate-ogp-images
image: reg.kazu634.com/kazu634/tcardgen
2021-05-06 13:48:30 +00:00
commands:
- find /root -type f -name *.ttf | xargs -t -I% -n 1 cp -p % assets/font/
- find content/ -type f -name '*.md' | grep -v '_index' | xargs -t -n 1 /usr/local/bin/tcardgen -f assets/font/ -o static/ogp/ -c assets/tcardgen.yaml > /dev/null
2021-05-06 13:48:30 +00:00
- find static/ogp/ -type f -name '*.png' | xargs -n 1 -I% basename % .png | xargs -I% -n 1 img2webp -lossy -q 50 static/ogp/%.png -o static/ogp/%.webp > /dev/null
- find static/ogp/ -type f -name '*.png' | xargs --no-run-if-empty rm
2021-11-14 13:27:59 +00:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2020-01-19 04:19:39 +00:00
- name: hugo
2023-07-29 14:03:59 +00:00
image: cibuilds/hugo:0.115.4
2020-01-19 04:19:39 +00:00
commands:
2020-04-18 15:11:38 +00:00
- sudo hugo -e production --minify -v -s .
2020-01-19 04:19:39 +00:00
2020-01-05 12:22:05 +00:00
- name: Compress-the-Assets
2020-02-16 15:08:57 +00:00
image: alpine:3.9
2020-01-05 12:51:36 +00:00
commands:
2020-04-30 15:56:32 +00:00
- find public/ -type f | egrep "\.(css|js|png|jpg|html|JPG|PNG|CSS|JS|HTML)$" | xargs -n 1 -i% -P 0 sh -c 'cp % %.bk && gzip % && mv %.bk %'
2020-01-19 04:19:39 +00:00
- name: housekeep
image: appleboy/drone-ssh
settings:
2023-07-29 14:03:59 +00:00
host: 10.0.1.222
username: webadm
port: 10022
key:
from_secret: ssh_key
script:
- rm -rf /var/www/blog/*
2020-01-19 09:40:07 +00:00
- rm -rf /home/webadm/works/public/*
2020-01-19 04:37:58 +00:00
- name: scp
image: appleboy/drone-scp
settings:
2023-07-29 14:03:59 +00:00
host: 10.0.1.222
2020-01-19 04:37:58 +00:00
username: webadm
port: 10022
target:
- /var/www/blog
- /home/webadm/works/public
2020-01-19 04:37:58 +00:00
source: public/
key:
from_secret: ssh_key
2020-01-19 05:06:48 +00:00
overwrite: true
2020-01-19 04:54:32 +00:00
strip_components: 1
2020-01-05 12:22:05 +00:00
2020-01-19 04:36:24 +00:00
trigger:
2020-01-19 06:37:17 +00:00
branch:
2024-01-21 10:54:07 +00:00
- main
2020-01-19 06:37:17 +00:00
---
kind: pipeline
type: docker
name: staging
steps:
- name: Modify-Amazon-Links
2020-02-16 14:56:50 +00:00
image: alpine:3.9
2020-01-19 06:37:17 +00:00
commands:
- 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"
- 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 06:37:17 +00:00
2021-11-14 13:27:59 +00:00
- name: submodules
image: alpine/git
commands:
- git submodule update --init --recursive
2020-01-19 06:37:17 +00:00
- name: hugo
2023-07-29 14:03:59 +00:00
image: cibuilds/hugo:0.115.4
2020-01-19 06:37:17 +00:00
commands:
2020-04-18 15:11:38 +00:00
- sudo hugo -e staging --minify -v -s .
2020-01-19 06:37:17 +00:00
- name: Compress-the-Assets
2020-02-16 14:56:50 +00:00
image: alpine:3.9
2020-01-19 06:37:17 +00:00
commands:
2020-04-30 15:56:32 +00:00
- find public/ -type f | egrep "\.(css|js|png|jpg|html|JPG|PNG|CSS|JS|HTML)$" | xargs -n 1 -i% -P 0 sh -c 'cp % %.bk && gzip % && mv %.bk %'
2020-01-19 06:37:17 +00:00
- name: housekeep
image: appleboy/drone-ssh
settings:
2023-07-29 14:03:59 +00:00
host: 10.0.1.222
username: webadm
port: 10022
key:
from_secret: ssh_key
script:
- rm -rf /var/www/test/*
2020-01-19 06:37:17 +00:00
- name: scp
image: appleboy/drone-scp
settings:
2023-07-29 14:03:59 +00:00
host: 10.0.1.222
2020-01-19 06:37:17 +00:00
username: webadm
port: 10022
target: /var/www/test
source: public/
key:
from_secret: ssh_key
overwrite: true
strip_components: 1
trigger:
branch:
exclude:
2024-01-21 10:54:07 +00:00
- main