Skip to content

Update README.md

Update README.md #17

Workflow file for this run

name: Deploy Pages
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build # 这会生成 docs 目录
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Clear old documentation
working-directory: gh-pages
run: |
find . -maxdepth 1 ! -name 'CNAME' ! -name '.git' ! -name '.' ! -name '..' -exec rm -rf {} +
- name: Copy docs to gh-pages directory
run: cp -r docs/* gh-pages/
- name: Commit and push to gh-pages
working-directory: gh-pages
run: |
git config user.email "[email protected]"
git config user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || echo "No changes to commit"
git push --force origin gh-pages