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.
 
 
 

57 lines
1.6 KiB

kind: pipeline
name: default
steps:
- name: 生成静态资源
image: plugins/hugo
settings:
# 指定hugo版本
hugo_version: 0.101.0
# 是否校验配置文件是否合法
# validate: true
# 指定配置文件
config: config.toml
# 指定文章目录
content: content
# 指定生成的静态资源路径
output: ./www.naifei365.com
- name: 推送到服务器
image: appleboy/drone-scp
settings:
# 服务器IP
host:
from_secret: host
# 需要替换的服务器的路径,我的是服务器的`/data/hugo`目录,由于打包的文件的路径就是`hugo`,所以这儿只需要写`/data`即可
target: /data/webs/
# 本地生成的静态资源的路径
source: www.naifei365.com/*
# 服务器账号
username: root
# 服务器登录密码
password:
from_secret: password
# 服务器端口
port: 22
# 覆盖更新
overwrite: true
when:
# 当仓库的 master 分支收到 push 事件,并且前一步构建成功的时候触发当前步骤
event: push
branch: master
status: success
- name: 发送电报通知消息
image: appleboy/drone-telegram
settings:
token:
from_secret: telegram_token
to:
from_secret: telegram_to
message: >
{{#success build.status}}
www.naifei365.com更新成功
{{else}}
www.naifei365.com更新失败
{{/success}}
更新记录内容:{{commit.message}}