feat: add strict ESLint config and fix all lint issues #28
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 to Vercel | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install dependencies and build | |
| run: npm run build:ci | |
| env: | |
| NEXT_PUBLIC_DEPLOY_TIME: ${{ github.event.head_commit.timestamp }} | |
| - name: Run linting | |
| run: npm run lint --if-present | |
| - name: Run tests | |
| run: npm run test --if-present | |
| - name: Deploy to Vercel (Preview) | |
| if: github.event_name == 'pull_request' | |
| uses: amondnet/vercel-action@v25 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| vercel-args: '--prod=false' | |
| working-directory: ./ | |
| alias-domains: |- | |
| pr-{{ pr-number }}.${{ secrets.VERCEL_TEAM_URL }} | |
| - name: Deploy to Vercel (Production) | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: amondnet/vercel-action@v25 | |
| with: | |
| vercel-token: ${{ secrets.VERCEL_TOKEN }} | |
| vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} | |
| vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} | |
| vercel-args: '--prod=true' | |
| working-directory: ./ | |
| - name: Health Check | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: | | |
| echo "Deployment completed successfully" | |
| echo "Site will be available at: https://${{ secrets.VERCEL_TEAM_URL }}" |