docs: 添加 useState 和 useMemo 泛型示例,更新 Loading 组件的 props 类型声明 #59
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 GitHub Pages | |
# 触发条件:在 push 到 master 分支后 | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-and-deploy: | |
# 服务器环境:最新版 Ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
# 拉取代码 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
# 会拉取全部的历史提交记录 | |
fetch-depth: 0 | |
# 安装 pnpm | |
- name: Install pnpm | |
run: npm install -g pnpm | |
# 1、生成静态文件 | |
- name: Build | |
run: pnpm install && pnpm docs:build | |
# 2、部署到 GitHub Pages | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
REPOSITORY_NAME: ZtfCoder/ZtfCoder.github.io | |
BRANCH: master | |
FOLDER: docs/.vitepress/dist | |
#注意这里的 public 是仓库根目录下的 public,也就是 npm run build 生成静态资源的路径,比如有的人是 `docs/.vuepress/dist` | |
# sync: | |
# needs: build-and-deploy | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Sync to Gitee | |
# uses: wearerequired/git-mirror-action@master | |
# env: | |
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} | |
# with: | |
# # 来源仓库 | |
# source-repo: "git@github.com:ZtfCoder/ZtfCoder.github.io.git" | |
# # 目标仓库 | |
# destination-repo: "git@gitee.com:zhanggob/ztf_pages.git" | |
# reload-pages: | |
# needs: sync | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Build Gitee Pages | |
# uses: yanglbme/gitee-pages-action@main | |
# with: | |
# # 注意替换为你的 Gitee 用户名 | |
# gitee-username: ztf | |
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD | |
# gitee-password: ${{ secrets.GITEE_PASSWORD }} | |
# # 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错 | |
# gitee-repo: zhanggob/ztf_pages | |
# # 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在) | |
# branch: master |