Make frontend CI generic for template repo #22
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: Frontend CI & Deploy (Vercel) | |
| on: [push, pull_request] | |
| jobs: | |
| build-frontend: | |
| runs-on: ubuntu-latest | |
| # Removed defaults: run: working-directory: client | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| # Run commands in root, with fallback to prevent failures in template repo | |
| - run: npm install || echo "No package.json found, skipping npm install" | |
| - run: npm run lint || echo "No lint script found, skipping lint" | |
| - run: npm run build || echo "No build script found, skipping build" | |
| deploy-vercel: | |
| runs-on: ubuntu-latest | |
| needs: build-frontend | |
| steps: | |
| - 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 }} | |
| # Removed working-directory: ./client |