everun/.drone.yml

105 lines
2.1 KiB
YAML
Raw Normal View History

2023-01-03 03:55:28 +00:00
kind: pipeline
type: docker
name: production
steps:
- name: submodules
image: alpine/git
commands:
- apk add git-lfs
2023-01-03 03:55:28 +00:00
- git submodule update --init --recursive
- git lfs pull
2023-01-03 03:55:28 +00:00
- name: hugo
2023-07-29 13:55:56 +00:00
image: cibuilds/hugo:0.115.4
2023-01-03 03:55:28 +00:00
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:
2023-07-09 11:46:44 +00:00
host: 10.0.1.222
2023-01-03 03:55:28 +00:00
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:
2023-07-09 11:46:44 +00:00
host: 10.0.1.222
2023-01-03 03:55:28 +00:00
username: webadm
port: 10022
target:
- /var/www/everun
2023-08-20 12:22:03 +00:00
- /home/webadm/works/everun
2023-01-03 03:55:28 +00:00
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:
- apk add git-lfs
2023-01-03 03:55:28 +00:00
- git submodule update --init --recursive
- git lfs pull
2023-01-03 03:55:28 +00:00
- name: hugo
2023-07-29 13:55:56 +00:00
image: cibuilds/hugo:0.115.4
2023-01-03 03:55:28 +00:00
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:
2023-07-09 11:46:44 +00:00
host: 10.0.1.222
2023-01-03 03:55:28 +00:00
username: webadm
port: 10022
key:
from_secret: ssh_key
script:
- rm -rf /var/www/test-everun/*
- name: scp
image: appleboy/drone-scp
settings:
2023-07-09 11:46:44 +00:00
host: 10.0.1.222
2023-01-03 03:55:28 +00:00
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