-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.1 KB
/
deploy.yml
1
2
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
49
50
name: 自动部署 Hexo
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: 开始运行
uses: actions/checkout@v1
- name: 设置 Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: 配置 Git 环境
env:
ACTION_DEPLOY_KEY: ${{ secrets.ACTION_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$ACTION_DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name "wjz"
git config --global user.email "1637011263@qq.com"
- name: 安装 Hexo CI
run: |
export TZ='Asia/Shanghai'
npm i -g hexo-cli
npm i
- name: 安装插件
run: |
npm i
- name: 部署博客
run: |
rm -rf .deploy_git
hexo g -d
rm ~/.ssh/id_rsa