Feat/optimize-local-ui-image #8
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: Code Check | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'dify-helm-watchdog/**' | |
| - '.github/workflows/**' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'dify-helm-watchdog/**' | |
| - '.github/workflows/**' | |
| jobs: | |
| lint-and-build: | |
| name: Lint & Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./dify-helm-watchdog | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'yarn' | |
| cache-dependency-path: 'dify-helm-watchdog/yarn.lock' | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run ESLint | |
| run: yarn lint | |
| - name: Run TypeScript type check | |
| run: yarn tsc --noEmit | |
| - name: Build project | |
| run: yarn build | |
| env: | |
| # 使用示例环境变量,构建时不需要实际的 Blob token | |
| BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN || 'dummy-token-for-build' }} | |
| ENABLE_LOCAL_MODE: 'true' | |
| - name: Check build output | |
| run: | | |
| if [ ! -d ".next" ]; then | |
| echo "❌ Build failed: .next directory not found" | |
| exit 1 | |
| fi | |
| echo "✅ Build successful!" | |
| ls -lah .next | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: build-output-node-${{ matrix.node-version }} | |
| path: dify-helm-watchdog/.next | |
| retention-days: 7 | |
| compression-level: 9 | |