Skip to content

20251211

20251211 #309

Workflow file for this run

name: Hexo Deploy Automatically
on:
push:
branches:
# The branch where the project source code resides
# 项目源代码所在的分支
- hexo
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install git-restore-mtime from source
run: |
git log --oneline -n 10
git clone https://github.com/MestreLion/git-tools.git
sudo install git-tools/git-restore-mtime /usr/local/bin/git-restore-mtime
# Step 3. 恢复文件时间戳
- name: Restore file modification times
run: |
git restore-mtime
# Step 4. (可选)查看结果
- name: Verify timestamps
run: |
git restore-mtime -v
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Generate
run: |
npm i && npx hexo g
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: main
publish_dir: ./public
force_orphan: true