update twitter auth #73
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: TrueCall CI | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master, develop] | |
| jobs: | |
| check-changes: | |
| name: π Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend: ${{ steps.filter.outputs.backend }} | |
| frontend: ${{ steps.filter.outputs.frontend }} | |
| contracts: ${{ steps.filter.outputs.contracts }} | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π Check for file changes | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| backend: | |
| - 'backend/**' | |
| frontend: | |
| - 'frontend/**' | |
| contracts: | |
| - 'contracts/**' | |
| backend-check: | |
| name: π§ Backend Check | |
| needs: check-changes | |
| if: needs.check-changes.outputs.backend == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π¦ Setup pnpm | |
| uses: pnpm/action-setup@v3 | |
| with: | |
| version: 10 | |
| - name: π’ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: "pnpm" | |
| cache-dependency-path: backend/pnpm-lock.yaml | |
| - name: π₯ Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: π Lint code | |
| run: pnpm run lint | |
| continue-on-error: true | |
| - name: ποΈ Build | |
| run: pnpm run build | |
| - name: β Backend OK | |
| run: echo "β Backend build successful" | |
| frontend-check: | |
| name: π¨ Frontend Check | |
| needs: check-changes | |
| if: needs.check-changes.outputs.frontend == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - name: π₯ Checkout code | |
| uses: actions/checkout@v4 | |
| - name: π’ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: π₯ Install dependencies | |
| run: npm ci | |
| - name: π Lint code | |
| run: npm run lint | |
| continue-on-error: true | |
| - name: ποΈ Build | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_API_URL: https://example.com/api | |
| - name: β Frontend OK | |
| run: echo "β Frontend build successful" | |
| all-checks-passed: | |
| name: β All Checks Passed | |
| runs-on: ubuntu-latest | |
| needs: [backend-check, frontend-check] | |
| if: always() | |
| steps: | |
| - name: β Success | |
| if: ${{ !contains(needs.*.result, 'failure') }} | |
| run: | | |
| echo "π All checks passed!" | |
| echo "β Code is ready for deployment" | |
| - name: β Failure | |
| if: ${{ contains(needs.*.result, 'failure') }} | |
| run: | | |
| echo "β Some checks failed" | |
| echo "β Please fix errors before deploying" | |
| exit 1 |