2023-01-03 03:55:28 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: production
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
2023-01-03 04:01:52 +00:00
|
|
|
- apk add git-lfs
|
2023-01-03 03:55:28 +00:00
|
|
|
- git submodule update --init --recursive
|
2023-01-03 04:01:52 +00:00
|
|
|
- git lfs pull
|
2023-01-03 03:55:28 +00:00
|
|
|
|
|
|
|
- name: hugo
|
|
|
|
image: cibuilds/hugo:0.106
|
|
|
|
commands:
|
|
|
|
- sudo hugo -e production --minify -v -s .
|
|
|
|
|
|
|
|
- name: Compress-the-Assets
|
|
|
|
image: alpine:3.9
|
|
|
|
commands:
|
|
|
|
- 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 %'
|
|
|
|
|
|
|
|
- name: housekeep
|
|
|
|
image: appleboy/drone-ssh
|
|
|
|
settings:
|
|
|
|
host: 10.0.1.166
|
|
|
|
username: webadm
|
|
|
|
port: 10022
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
script:
|
|
|
|
- rm -rf /var/www/everun/*
|
|
|
|
- rm -rf /home/webadm/works/public/*
|
|
|
|
|
|
|
|
- name: scp
|
|
|
|
image: appleboy/drone-scp
|
|
|
|
settings:
|
|
|
|
host: 10.0.1.166
|
|
|
|
username: webadm
|
|
|
|
port: 10022
|
|
|
|
target:
|
|
|
|
- /var/www/everun
|
|
|
|
- /home/webadm/works/public
|
|
|
|
source: public/
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
overwrite: true
|
|
|
|
strip_components: 1
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
- master
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: staging
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: submodules
|
|
|
|
image: alpine/git
|
|
|
|
commands:
|
2023-01-03 04:01:52 +00:00
|
|
|
- apk add git-lfs
|
2023-01-03 03:55:28 +00:00
|
|
|
- git submodule update --init --recursive
|
2023-01-03 04:01:52 +00:00
|
|
|
- git lfs pull
|
2023-01-03 03:55:28 +00:00
|
|
|
|
|
|
|
- name: hugo
|
|
|
|
image: cibuilds/hugo:0.106
|
|
|
|
commands:
|
|
|
|
- sudo hugo -e staging --minify -v -s .
|
|
|
|
|
|
|
|
- name: Compress-the-Assets
|
|
|
|
image: alpine:3.9
|
|
|
|
commands:
|
|
|
|
- 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 %'
|
|
|
|
|
|
|
|
- name: housekeep
|
|
|
|
image: appleboy/drone-ssh
|
|
|
|
settings:
|
|
|
|
host: 10.0.1.166
|
|
|
|
username: webadm
|
|
|
|
port: 10022
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
script:
|
|
|
|
- rm -rf /var/www/test-everun/*
|
|
|
|
|
|
|
|
- name: scp
|
|
|
|
image: appleboy/drone-scp
|
|
|
|
settings:
|
|
|
|
host: 10.0.1.166
|
|
|
|
username: webadm
|
|
|
|
port: 10022
|
|
|
|
target: /var/www/test-everun
|
|
|
|
source: public/
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
overwrite: true
|
|
|
|
strip_components: 1
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
branch:
|
|
|
|
exclude:
|
|
|
|
- master
|