-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.36 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
51
52
53
name: Deploy Hexo
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check Out
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v3
with:
version: latest
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install Dependencies
run: |
pnpm install
# https://github.com/zhullyb/zhullyb.github.io/blob/master/.github/workflows/deploy.yml
# 修复 hexo 生成的文件更新时间 为当前时间,实际应为提交时间
- name: Fix File Updated Date
run: |
git ls-files "*.md" | while read filepath; do touch -d "$(git log -1 --format='@%ct' $filepath)" "$filepath" && echo "Fixed: $filepath"; done
- name: Build Site
run: |
pnpm build
- name: Move baidu_verify
run: |
cp asset/baidu_verify_codeva-GwRsL4VPtx.html.html public/
cp asset/naver57322dd0ed14599dd3052c79c6892766.html public/
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public
force_orphan: true