Harshvardhan-91 is building Sortify 🚀 #24
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: Sortify CI/CD Pipeline | |
| run-name: ${{ github.actor }} is building Sortify 🚀 | |
| # Trigger the workflow on push to main branch and pull requests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Define environment variables | |
| env: | |
| NODE_VERSION: "18" | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | |
| jobs: | |
| #=Install dependencies and build the project | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout the repository code | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper turbo caching | |
| # Setup Node.js with caching | |
| - name: Setup Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "npm" | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: npm ci | |
| # Validate turbo configuration | |
| - name: Validate Turbo setup | |
| run: npx turbo --version | |
| # Run linting across all packages (allow warnings for now, will be strict later) | |
| - name: Lint code | |
| run: | | |
| echo "Running ESLint across all packages..." | |
| npm run lint || echo "Linting issues found - will be addressed in development" | |
| continue-on-error: true | |
| # Generate Prisma client | |
| - name: Generate Prisma client | |
| run: npm run db:generate | |
| # Build all packages and apps | |
| - name: Build project | |
| run: npm run build | |
| # Notify on success | |
| - name: Success notification | |
| run: | | |
| echo "Sortify CI/CD Pipeline completed successfully!" | |
| echo "Branch: ${{ github.ref_name }}" | |
| echo "Author: ${{ github.actor }}" | |
| echo "Commit: ${{ github.sha }}" |