This repository was archived by the owner on Apr 17, 2026. It is now read-only.
Main CI/CD Pipeline #803
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: Main CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: '0 */6 * * *' # Every 6 hours for monitoring | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| security-events: write | |
| actions: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| # =============================== | |
| # 🔍 Code Quality & Testing | |
| # =============================== | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'schedule' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Type checking | |
| run: npm run type-check | |
| - name: Run tests | |
| run: npm test | |
| # =============================== | |
| # 🛡️ Security Analysis | |
| # =============================== | |
| security: | |
| name: Security Scan | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'schedule' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run npm audit | |
| run: npm audit --audit-level=moderate || true | |
| - name: Dependency Review | |
| if: github.event_name == 'pull_request' | |
| uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0 | |
| # =============================== | |
| # 🏗️ Build Test | |
| # =============================== | |
| build: | |
| name: Build Test | |
| runs-on: ubuntu-latest | |
| needs: [quality, security] | |
| if: github.event_name != 'schedule' && (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build application | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
| NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }} | |
| # =============================== | |
| # 🔍 Airdrop Monitoring | |
| # =============================== | |
| monitor: | |
| name: Monitor Airdrops | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Trigger monitoring | |
| run: | | |
| response=$(curl -s -o /dev/null -w "%{http_code}" \ | |
| -X GET "https://fardrops.xyz/api/monitor/trigger?secret=${{ secrets.CRON_SECRET }}") | |
| if [ "$response" -eq 200 ]; then | |
| echo "✅ Monitoring triggered successfully" | |
| else | |
| echo "⚠️ Monitoring returned status code: $response" | |
| fi | |
| - name: Health check | |
| run: | | |
| curl -f -X HEAD https://fardrops.xyz/api/monitor/trigger || \ | |
| echo "Health check endpoint returned non-200 status" | |