Simplified the initialization to explicitly check and create the clie… #39
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/CD | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| FIRECRAWL_KEY: ${{ secrets.FIRECRAWL_KEY }} | |
| OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} | |
| OPENAI_KEY: ${{ secrets.OPENAI_KEY }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Create env file | |
| run: | | |
| echo "FIRECRAWL_KEY=${{ secrets.FIRECRAWL_KEY }}" >> .env | |
| echo "OPENAI_MODEL=${{ secrets.OPENAI_MODEL }}" >> .env | |
| echo "OPENAI_KEY=${{ secrets.OPENAI_KEY }}" >> .env | |
| - name: Run Tests | |
| run: npm test | |
| - name: Install Prisma CLI | |
| run: npm install prisma --save-dev | |
| - name: Build | |
| run: npm run build | |
| - name: Deploy to Production | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| # Add your deployment commands here | |
| echo "Deploying to production..." |