release: 0.0.5 #19
Workflow file for this run
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
# 构建VitePress网站并将其部署到GitHub页面的示例工作流 | |
name: Deploy VitePress site to Pages | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- src/docs/** | |
tags: | |
- 'v*' | |
#允许从页面手动运行此工作流 | |
workflow_dispatch: | |
#设置GITHUB_TOKEN的权限以允许部署到GITHUB页面 | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
#只允许一次并发部署,跳过在进行中的运行和最近排队的运行之间排队的运行。 | |
#但是,不要取消正在进行的运行,因为我们希望完成这些生产部署。 | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # 如果未启用lastUpdated,则不需要 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: npm # 或者 pnpm / yarn | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Install dependencies | |
run: npm ci # 或者 pnpm install / yarn install / bun install | |
- name: Build Quicktab | |
run: npm run build | |
- name: Copy dist and demo dir to vitepress public dir | |
run: npm run demo:build | |
- name: Build with VitePress | |
run: npm run docs:build # 或者 pnpm docs:build / yarn docs:build / bun run docs:build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: src/docs/.vitepress/dist | |
# 部署任务 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |