Refactor HomePage and enhance project types #12
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: Lighthouse CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| lighthouse: | |
| name: Lighthouse Performance Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: pnpm | |
| - name: Install dependencies | |
| continue-on-error: false | |
| run: pnpm install --frozen-lockfile --ignore-scripts | |
| - name: Build application | |
| run: pnpm build | |
| - name: Start server | |
| run: pnpm start & | |
| env: | |
| PORT: 3000 | |
| - name: Wait for server | |
| run: | | |
| timeout=60 | |
| elapsed=0 | |
| while ! curl -f http://localhost:3000 > /dev/null 2>&1; do | |
| if [ $elapsed -ge $timeout ]; then | |
| echo "Server failed to start within $timeout seconds" | |
| exit 1 | |
| fi | |
| sleep 2 | |
| elapsed=$((elapsed + 2)) | |
| done | |
| echo "Server is ready" | |
| - name: Run Lighthouse CI | |
| uses: treosh/lighthouse-ci-action@v11 | |
| with: | |
| urls: | | |
| http://localhost:3000/ | |
| http://localhost:3000/landing | |
| uploadArtifacts: true | |
| temporaryPublicStorage: true | |
| configPath: ./.lighthouserc.json | |
| - name: Check Lighthouse scores | |
| run: | | |
| # Extract scores from Lighthouse CI output | |
| # This is a simplified check - in production, use lighthouse-ci's built-in assertions | |
| echo "Lighthouse audit completed. Check the artifacts for detailed reports." | |