feat: data-demo file copy frequency #67
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 to GitHub Pages # 自定义工作流名称 | |
on: # 触发条件 | |
push: # 当推送时触发 | |
branches: # 推送到哪些分支时触发 | |
- master # 当推送到 master 分支时,触发 deploy 构建 | |
pull_request: # 当 PR 时触发 | |
branches: # PR 到哪些分支时触发 | |
- master # 当 PR 到 master 分支时,触发 deploy 构建 | |
workflow_dispatch: # 手动触发 | |
branches: # 手动触发时,触发 deploy 构建 | |
- master # 手动触发时,触发 deploy 构建 | |
jobs: # 一个工作流可以包含多个 job | |
build-and-deploy: # 自定义 job 名称 | |
runs-on: ubuntu-latest # 运行环境 | |
steps: # job 包含的步骤 | |
- name: Checkout code # 步骤名称 | |
uses: actions/checkout@v4 # 使用的 action | |
- name: Setup Node.js # 安装 Node.js | |
uses: actions/setup-node@v4 # 使用的 action | |
with: # action 参数 | |
node-version: '20' # 设置 Node.js 版本 | |
- name: Install pnpm # 安装依赖 | |
run: npm install -g pnpm # 执行命令 | |
- name: Install dependencies # 安装依赖 | |
run: pnpm install # 执行命令 | |
- name: Build project # 构建项目 | |
run: pnpm build:github # 执行命令 | |
- name: Deploy to GitHub Pages # 部署到 GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@4.1.4 # 使用的 action | |
with: # action 参数 | |
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token | |
BRANCH: gh-pages # 部署到的分支 | |
FOLDER: dist # 部署的文件夹 |