Initial commit — RoadCode import
Some checks failed
☁️ Cloudflare Deployment / Deploy Workers (push) Has been cancelled
🚂 Railway Deployment / Deploy to Railway (push) Has been cancelled
🌐 Unified Multi-Platform Deployment / 🔍 Prepare (push) Has been cancelled
▲ Vercel Deployment / Deploy to Vercel (push) Has been cancelled
🌐 Unified Multi-Platform Deployment / 🚀 Deploy all platforms (push) Has been cancelled
🔒 Security Scanning / 📦 Dependencies (push) Failing after 40s
🔒 Security Scanning / 🔐 Secrets (push) Failing after 1m34s
💾 Automated Backup / 📦 Backup infrastructure (push) Failing after 45s
🏥 Infrastructure Health Monitoring / 🔍 Health Check (push) Successful in 2s
Some checks failed
☁️ Cloudflare Deployment / Deploy Workers (push) Has been cancelled
🚂 Railway Deployment / Deploy to Railway (push) Has been cancelled
🌐 Unified Multi-Platform Deployment / 🔍 Prepare (push) Has been cancelled
▲ Vercel Deployment / Deploy to Vercel (push) Has been cancelled
🌐 Unified Multi-Platform Deployment / 🚀 Deploy all platforms (push) Has been cancelled
🔒 Security Scanning / 📦 Dependencies (push) Failing after 40s
🔒 Security Scanning / 🔐 Secrets (push) Failing after 1m34s
💾 Automated Backup / 📦 Backup infrastructure (push) Failing after 45s
🏥 Infrastructure Health Monitoring / 🔍 Health Check (push) Successful in 2s
This commit is contained in:
40
.github/workflows/automated-backup.yml
vendored
Normal file
40
.github/workflows/automated-backup.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: 💾 Automated Backup
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 2 * * *' # Daily at 2 AM UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
backup:
|
||||
name: 📦 Backup infrastructure
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 💾 Create backup
|
||||
run: |
|
||||
BACKUP_DATE=$(date +%Y%m%d_%H%M%S)
|
||||
BACKUP_DIR="backups/backup_${BACKUP_DATE}"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
# Backup configs
|
||||
cp -r .github "$BACKUP_DIR/" 2>/dev/null || true
|
||||
cp *.json *.toml *.md "$BACKUP_DIR/" 2>/dev/null || true
|
||||
|
||||
# Create archive
|
||||
tar -czf "backup_${BACKUP_DATE}.tar.gz" "$BACKUP_DIR"
|
||||
|
||||
echo "### 💾 Backup Created" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Date**: $BACKUP_DATE" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Size**: $(du -h backup_${BACKUP_DATE}.tar.gz | cut -f1)" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
- name: 📤 Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: blackroad-private-backup-${{ github.run_number }}
|
||||
path: backup_*.tar.gz
|
||||
retention-days: 30
|
||||
50
.github/workflows/cloudflare-deploy.yml
vendored
Normal file
50
.github/workflows/cloudflare-deploy.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: ☁️ Cloudflare Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
paths: ['src/**', 'workers/**', 'wrangler.toml']
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy-workers:
|
||||
name: Deploy Workers
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🔧 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 📦 Install
|
||||
run: npm ci
|
||||
|
||||
- name: 🏗️ Build
|
||||
run: npm run build --if-present
|
||||
|
||||
- name: 🚀 Deploy Workers
|
||||
uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
command: deploy --env production
|
||||
|
||||
- name: 🧹 Purge cache
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE_ID }}/purge_cache" \
|
||||
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
--data '{"purge_everything":true}'
|
||||
|
||||
- name: 📊 Summary
|
||||
run: |
|
||||
echo "### ☁️ Cloudflare Deployment Success" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Worker**: blackroad-private" >> $GITHUB_STEP_SUMMARY
|
||||
53
.github/workflows/infrastructure-health.yml
vendored
Normal file
53
.github/workflows/infrastructure-health.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: 🏥 Infrastructure Health Monitoring
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '*/15 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
health-check:
|
||||
name: 🔍 Health Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 🚂 Railway
|
||||
id: railway
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ -n "${{ secrets.RAILWAY_HEALTH_URL }}" ]; then
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "${{ secrets.RAILWAY_HEALTH_URL }}")
|
||||
[ "$STATUS" -eq 200 ] && echo "status=healthy" >> $GITHUB_OUTPUT || echo "status=unhealthy" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "status=skipped" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: ☁️ Cloudflare
|
||||
id: cloudflare
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ -n "${{ secrets.CLOUDFLARE_HEALTH_URL }}" ]; then
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "${{ secrets.CLOUDFLARE_HEALTH_URL }}")
|
||||
[ "$STATUS" -eq 200 ] && echo "status=healthy" >> $GITHUB_OUTPUT || echo "status=unhealthy" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "status=skipped" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: ▲ Vercel
|
||||
id: vercel
|
||||
continue-on-error: true
|
||||
run: |
|
||||
if [ -n "${{ secrets.VERCEL_HEALTH_URL }}" ]; then
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" "${{ secrets.VERCEL_HEALTH_URL }}")
|
||||
[ "$STATUS" -eq 200 ] && echo "status=healthy" >> $GITHUB_OUTPUT || echo "status=unhealthy" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "status=skipped" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: 📊 Report
|
||||
run: |
|
||||
echo "### 🏥 Infrastructure Health Report" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Platform | Status | Time |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|----------|--------|------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Railway | ${{ steps.railway.outputs.status == 'healthy' && '✅' || steps.railway.outputs.status == 'skipped' && '⏭️' || '❌' }} | $(date -u '+%H:%M UTC') |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Cloudflare | ${{ steps.cloudflare.outputs.status == 'healthy' && '✅' || steps.cloudflare.outputs.status == 'skipped' && '⏭️' || '❌' }} | $(date -u '+%H:%M UTC') |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Vercel | ${{ steps.vercel.outputs.status == 'healthy' && '✅' || steps.vercel.outputs.status == 'skipped' && '⏭️' || '❌' }} | $(date -u '+%H:%M UTC') |" >> $GITHUB_STEP_SUMMARY
|
||||
54
.github/workflows/railway-deploy.yml
vendored
Normal file
54
.github/workflows/railway-deploy.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: 🚂 Railway Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
description: 'Deployment environment'
|
||||
required: true
|
||||
default: 'production'
|
||||
type: choice
|
||||
options: [production, staging, preview]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Railway
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ github.event.inputs.environment || 'production' }}
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🔧 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: 📦 Install Railway CLI
|
||||
run: npm install -g @railway/cli
|
||||
|
||||
- name: 🏗️ Build
|
||||
run: |
|
||||
if [ -f package.json ]; then
|
||||
npm ci
|
||||
npm run build --if-present
|
||||
fi
|
||||
|
||||
- name: 🚀 Deploy
|
||||
run: |
|
||||
railway link ${{ secrets.RAILWAY_PROJECT_ID }}
|
||||
railway up --service blackroad-private --environment ${{ github.event.inputs.environment || 'production' }}
|
||||
env:
|
||||
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
|
||||
|
||||
- name: 📊 Summary
|
||||
run: |
|
||||
echo "### 🚂 Railway Deployment Success" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Environment**: ${{ github.event.inputs.environment || 'production' }}" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
||||
58
.github/workflows/security-scan.yml
vendored
Normal file
58
.github/workflows/security-scan.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
name: 🔒 Security Scanning
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
dependency-scan:
|
||||
name: 📦 Dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🔧 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: 📦 Install
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: 🔍 Audit
|
||||
continue-on-error: true
|
||||
run: |
|
||||
npm audit --audit-level=moderate --json > audit-results.json || true
|
||||
|
||||
- name: 📊 Report
|
||||
run: |
|
||||
echo "### 🔒 Security Audit" >> $GITHUB_STEP_SUMMARY
|
||||
if [ -f audit-results.json ]; then
|
||||
VULNS=$(jq '.metadata.vulnerabilities | to_entries[] | "\(.key): \(.value)"' audit-results.json 2>/dev/null || echo "No data")
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
echo "$VULNS" >> $GITHUB_STEP_SUMMARY
|
||||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
secrets-scan:
|
||||
name: 🔐 Secrets
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: 🔍 Scan
|
||||
uses: trufflesecurity/trufflehog@main
|
||||
with:
|
||||
path: ./
|
||||
base: ${{ github.event.repository.default_branch }}
|
||||
head: HEAD
|
||||
extra_args: --only-verified
|
||||
56
.github/workflows/unified-deploy.yml
vendored
Normal file
56
.github/workflows/unified-deploy.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: 🌐 Unified Multi-Platform Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
platforms:
|
||||
description: 'Platforms (railway,cloudflare,vercel)'
|
||||
default: 'railway,cloudflare,vercel'
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
name: 🔍 Prepare
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
railway: ${{ steps.check.outputs.railway }}
|
||||
cloudflare: ${{ steps.check.outputs.cloudflare }}
|
||||
vercel: ${{ steps.check.outputs.vercel }}
|
||||
steps:
|
||||
- name: 🔍 Check platforms
|
||||
id: check
|
||||
run: |
|
||||
PLATFORMS="${{ github.event.inputs.platforms || 'railway,cloudflare,vercel' }}"
|
||||
echo "railway=$([[ $PLATFORMS == *railway* ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
|
||||
echo "cloudflare=$([[ $PLATFORMS == *cloudflare* ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
|
||||
echo "vercel=$([[ $PLATFORMS == *vercel* ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
|
||||
|
||||
deploy-all:
|
||||
name: 🚀 Deploy all platforms
|
||||
needs: prepare
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🚂 Railway
|
||||
if: needs.prepare.outputs.railway == 'true'
|
||||
run: echo "Deploying to Railway..."
|
||||
|
||||
- name: ☁️ Cloudflare
|
||||
if: needs.prepare.outputs.cloudflare == 'true'
|
||||
run: echo "Deploying to Cloudflare..."
|
||||
|
||||
- name: ▲ Vercel
|
||||
if: needs.prepare.outputs.vercel == 'true'
|
||||
run: echo "Deploying to Vercel..."
|
||||
|
||||
- name: 📊 Summary
|
||||
run: |
|
||||
echo "### 🌐 Multi-Platform Deployment Complete" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Railway | ${{ needs.prepare.outputs.railway == 'true' && '✅' || '⏭️' }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Cloudflare | ${{ needs.prepare.outputs.cloudflare == 'true' && '✅' || '⏭️' }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| Vercel | ${{ needs.prepare.outputs.vercel == 'true' && '✅' || '⏭️' }} |" >> $GITHUB_STEP_SUMMARY
|
||||
49
.github/workflows/vercel-deploy.yml
vendored
Normal file
49
.github/workflows/vercel-deploy.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: ▲ Vercel Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Vercel
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🔧 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: 📦 Install Vercel CLI
|
||||
run: npm install -g vercel@latest
|
||||
|
||||
- name: 🔗 Pull environment
|
||||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
||||
env:
|
||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
||||
|
||||
- name: 🏗️ Build
|
||||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
||||
|
||||
- name: 🚀 Deploy
|
||||
id: deploy
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||
vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee deployment-url.txt
|
||||
else
|
||||
vercel deploy --prod --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee deployment-url.txt
|
||||
fi
|
||||
echo "url=$(cat deployment-url.txt | tail -1)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: 📊 Summary
|
||||
run: |
|
||||
echo "### ▲ Vercel Deployment Success" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **URL**: ${{ steps.deploy.outputs.url }}" >> $GITHUB_STEP_SUMMARY
|
||||
Reference in New Issue
Block a user