-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (46 loc) · 1.36 KB
/
hexo.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
51
52
53
54
55
56
name: Hexo Deploy
on:
push:
branches:
- main
jobs:
build-blog:
runs-on: ubuntu-latest
steps:
- name: 签出仓库
uses: actions/checkout@v4
with:
ref: main
- name: 签出主题仓库
uses: actions/checkout@v4
with:
repository: jerryc127/hexo-theme-butterfly
path: themes/butterfly
- name: 安装Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: 设置包缓存目录
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-npm-cache
restore-keys: ${{ runner.OS }}-npm-cache
- name: 安装依赖
run: npm install
- name: 构建
run: npm run build
- name: 上传构建产物
uses: actions/upload-pages-artifact@v3
with:
path: ./public
- name: Deploy to GitHub Pages
run: |
git config --global user.email "[email protected]"
git config --global user.name "Misaka-1314"
cd public
git init --initial-branch=main
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git add .
git commit -m "Deploy to GitHub Pages"
git push --force origin main:pages