chore: update package.json for vite-sentry and tailwind #25
This file contains hidden or 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: Build and Deploy Playground and Docs | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/playground/**' | |
| - 'docs/project-docs/**' | |
| - 'configs/**' | |
| - 'packages/**' | |
| - 'turbo.json' | |
| - 'package.json' | |
| - '.github/workflows/playground.yml' | |
| # 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages | |
| 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 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.10.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.18.1' # 与 volta 配置保持一致 | |
| cache: 'pnpm' | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build Playground | |
| run: pnpm build --filter=playground | |
| - name: Build docs | |
| run: pnpm build --filter=project-docs | |
| - name: Prepare deployment directory | |
| run: | | |
| mkdir -p ./deploy | |
| # 创建 playground 子目录并复制文件 | |
| mkdir -p ./deploy/playground | |
| cp -r ./apps/playground/dist/* ./deploy/playground/ | |
| # 创建 docs 子目录并复制文档 | |
| mkdir -p ./deploy/docs | |
| cp -r ./docs/project-docs/dist/* ./deploy/docs/ | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./deploy | |
| # 部署任务 | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |