Skip to content

update post

update post #185

Workflow file for this run

name: Hexo博客持续集成
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检出仓库代码
uses: actions/checkout@master
- name: 安装Node.js 14.x
uses: actions/setup-node@master
with:
node-version: "14.x"
- name: 安装Hexo依赖
run: |
npm install hexo-cli -g
npm install
- name: 构建Hexo
run: |
hexo clean
hexo generate
- name: 安装腾讯云依赖
run: |
sudo pip install coscmd==1.8.6.34
- name: 配置腾讯云依赖
env:
SECRET_ID: ${{ secrets.TCLOUD_API_ID }}
SECRET_KEY: ${{ secrets.TCLOUD_API_KEY }}
BUCKET: blog-1252906577
REGION: ap-shanghai
run: |
coscmd config -a $SECRET_ID -s $SECRET_KEY -b $BUCKET -r $REGION
- name: 上传到腾讯云COS
run: |
coscmd upload -rfs --delete ./public/ /
- name: 配置Git部署私钥
env:
HEXO_DEPLOY_PRIVATE_KEY: ${{ secrets.HEXO_DEPLOY_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$HEXO_DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: 配置Git信息
run: |
git config --global user.name 'dr34-m'
git config --global user.email '1416814478@qq.com'
- name: 部署Hexo到Git
run: hexo deploy