fix(build): 修搜尋 production 404 — build:search 順序前移到 astro build 之前 #117
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: CI | |
| # v0.4.8 重做:修兩個歷史問題 | |
| # 1. npm ci 找不到 package-lock.json (.gitignore 排除),改 npm install | |
| # 2. lint check 太嚴格(prettier nitpick 會 fail),拿掉 | |
| # 3. self-check.py 是單檔工具,不適 CI 批次;只跑 quality-scan.py | |
| # | |
| # 部署:Cloudflare Pages 直接從 git push 觸發,本 CI 不部署。 | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build verify | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Astro check | |
| run: npm run check | |
| continue-on-error: true # ts(6385) deprecation warnings 不阻擋 | |
| - name: Build | |
| run: npm run build | |
| - name: Upload build artifact | |
| if: github.event_name == 'pull_request' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: dist | |
| path: dist | |
| retention-days: 7 | |
| content-quality: | |
| name: Content Quality Scan | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Python dependencies | |
| run: | | |
| if [ -f scripts/requirements.txt ]; then | |
| pip install -r scripts/requirements.txt | |
| fi | |
| - name: Run quality scan | |
| run: python scripts/quality-scan.py | |
| continue-on-error: true # 開發期間不阻擋 |