Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

fix: remove redundant workflows and fix GitHub Actions failures #6

fix: remove redundant workflows and fix GitHub Actions failures

fix: remove redundant workflows and fix GitHub Actions failures #6

Workflow file for this run

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"
# ===============================
# 📦 Release Management
# ===============================
release:
name: Create Release
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Get version
id: version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Check if tag exists
id: check_tag
run: |
if git rev-parse "v${{ steps.version.outputs.version }}" >/dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Create Release
if: steps.check_tag.outputs.exists == 'false'
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
with:
tag_name: v${{ steps.version.outputs.version }}
name: Release v${{ steps.version.outputs.version }}
body: |
## 🎁 FarDrops v${{ steps.version.outputs.version }}
### What's Changed
- View commits: https://github.com/${{ github.repository }}/commits/v${{ steps.version.outputs.version }}
### Installation
```bash
git clone https://github.com/${{ github.repository }}.git
cd fardrops
npm install
```
**Full Changelog**: https://github.com/${{ github.repository }}/compare/v${{ steps.previous_tag.outputs.tag }}...v${{ steps.version.outputs.version }}
draft: false
prerelease: false
generate_release_notes: true