 
尝试使用更简单的博客部署方式
Github Actions
使用Github Actions当推送更新博客源码时进行部署,是现在能做到的最简单的方式了,还可以不用配置环境
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 
 | 
 
 name: Deploy Blog
 
 on:
 [push]
 
 jobs:
 build:
 
 runs-on: ubuntu-latest
 
 steps:
 - name: Checkout
 uses: actions/checkout@v2
 
 - name: Use Node.js 13.x
 uses: actions/setup-node@v1
 with:
 node-version: 13.x
 
 - name: Setup git
 env:
 ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
 run: |
 # set up private key for deploy
 mkdir -p ~/.ssh/
 echo "$ACTION_DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa # 配置秘钥
 chmod 600 ~/.ssh/id_rsa
 ssh-keyscan github.com >> ~/.ssh/known_hosts
 ssh-keyscan gitee.com >> ~/.ssh/known_hosts
 # set git infomation
 git config --global user.name 'hlapse' # 换成你自己的邮箱和名字
 git config --global user.email 'me@hlapse.top'
 
 - name: Setup hexo and Install dependencies
 run: |
 sudo yarn global add hexo-cli
 yarn install
 # 这一步是修改萌萌哒模型,将人物头发修改为黑色
 cp ./texture_00.png ./node_modules/live2d-widget-model-hibiki/assets/moc/hibiki.2048/
 
 - name: Deploy
 run: |
 # publish
 hexo generate && hexo deploy # 执行部署程序
 
 
 | 
Shell脚本
为了方便hexo部署与保存博客源码(懒),写了一个超简单的脚本,以后再慢慢完善吧(不会完善了,Github Actions真好用😀)
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 
 | #!/bin/bash# author: hlapse
 # url: hlapse.top
 
 # Delopy
 echo "Delopy Start!"
 hexo clean && hexo g && hexo d
 echo "Hexo部署完成"
 echo "开始推送博客源码"
 
 # update
 # message是commit的内容
 # 如果没有接受到参数,默认为"Hexo update"
 message="Hexo update"
 if [ $# ]
 then
 message=$1
 fi
 git commit -am $message
 git push
 
 echo "\\( ̄︶ ̄*\\))"
 
 | 
Typora
尝试使用一下这个Markdown编辑器
Typora真好用,所见即所得