feat(tools\custom-utils-jdk21): ValidateUtil 的使用 #137
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: Deploy VitePress to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| name: Build VitePress | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 100 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| cache-dependency-path: pnpm-lock.yaml | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Check runner resources | |
| run: | | |
| echo "Node version:" | |
| node -v | |
| echo "pnpm version:" | |
| pnpm -v | |
| echo "Memory:" | |
| free -h | |
| echo "Disk:" | |
| df -h | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Expand swap | |
| run: | | |
| # 使用磁盘临时扩展 swap,缓解大量 Markdown 构建时的 OOM | |
| sudo dd if=/dev/zero of=/mnt/swapfile bs=1M count=16384 status=progress | |
| sudo chmod 600 /mnt/swapfile | |
| sudo mkswap /mnt/swapfile | |
| sudo swapon /mnt/swapfile | |
| echo "Swap status:" | |
| swapon --show | |
| echo "Memory status:" | |
| free -h | |
| # 构建 | |
| - name: Build VitePress | |
| env: | |
| NODE_OPTIONS: --max-old-space-size=20480 | |
| run: pnpm docs:build | |
| - name: Validate build output | |
| run: | | |
| test -d .vitepress/dist | |
| test -f .vitepress/dist/index.html | |
| du -sh .vitepress/dist | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: .vitepress/dist | |
| retention-days: 1 | |
| deploy: | |
| name: Deploy GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |