chore: update article #216
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
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/ | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: public | |
force_orphan: true |