Skip to content

build(deps): bump hexo from 7.1.1 to 7.2.0 #19

build(deps): bump hexo from 7.1.1 to 7.2.0

build(deps): bump hexo from 7.1.1 to 7.2.0 #19

Workflow file for this run

name: Deploy Hexo Site
on:
pull_request:
branches:
- master
- main
paths:
- "scaffolds/**"
- "source/**"
- "themes/**"
- "_config.yml"
- "_config.*.yml"
- "package.json"
- "package-lock.json"
push:
branches:
- master
- main
paths:
- "scaffolds/**"
- "source/**"
- "themes/**"
- "_config.yml"
- "_config.*.yml"
- "package.json"
- "package-lock.json"
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "latest" # Use the latest Node.js version
- name: Cache dependencies 📦
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Hexo CLI
run: npm install -g hexo-cli
- name: Install dependencies 📁
run: npm install
- name: Generate Hexo static files
run: npx hexo generate
- name: Purge unused CSS 🧹
run: |
npm install -g purgecss
purgecss -c purgecss.config.js
- name: Deploy to gh-pages branch 🚀
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
# 删除gh-pages分支的现有文件
keep_files: false
# 指定发布到gh-pages分支
publish_branch: gh-pages