Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions .github/workflows/production-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,35 +282,46 @@ jobs:
- name: πŸš‚ Deploy to Railway
id: deploy
run: |
curl -fsSL https://railway.app/install.sh | sh
echo "Installing Railway CLI..."
# Use direct binary download as fallback if install script fails
if ! curl -fsSL https://railway.app/install.sh | sh; then
echo "Standard install failed, trying alternative method..."
curl -L -o railway https://github.com/railwayapp/cli/releases/latest/download/railway-linux-amd64
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded architecture 'linux-amd64' may not work on all GitHub Actions runners. Consider detecting the architecture dynamically or using a more generic approach that works across different runner types.

Suggested change
curl -L -o railway https://github.com/railwayapp/cli/releases/latest/download/railway-linux-amd64
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="linux-amd64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="linux-arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
curl -L -o railway https://github.com/railwayapp/cli/releases/latest/download/railway-$ARCH

Copilot uses AI. Check for mistakes.
chmod +x railway
sudo mv railway /usr/local/bin/
fi

echo "Logging into Railway..."
railway login --token ${{ secrets.RAILWAY_TOKEN }}
railway up --service neurobank-fastapi

echo "Deploying to Railway..."
railway up --service neurobank-fastapi --detach

echo "Deployment initiated successfully!"
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}

- name: πŸ₯ Post-Deployment Health Check
run: |
echo "Waiting for deployment to stabilize..."
sleep 30
sleep 60
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The fixed 60-second sleep is a magic number that may not be optimal for all deployments. Consider making this configurable via environment variable or implementing a proper polling mechanism to check deployment readiness.

Suggested change
sleep 60
sleep $DEPLOYMENT_WAIT_TIME

Copilot uses AI. Check for mistakes.

# Add your health check URL here
echo "Performing post-deployment health check..."
# curl -f https://your-railway-app-url.railway.app/health || exit 1
echo "βœ… Deployment health check passed!"
echo "Checking Railway deployment status..."
railway status --service neurobank-fastapi || echo "Status check completed"
Copy link

Copilot AI Jul 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling with '|| echo "Status check completed"' masks potential failures. The status check failure should be logged more clearly to help with debugging deployment issues.

Suggested change
railway status --service neurobank-fastapi || echo "Status check completed"
if ! railway status --service neurobank-fastapi; then
echo "❌ Deployment status check failed!"
echo "Please check the Railway dashboard for more details and ensure the service is running correctly."
exit 1
fi

Copilot uses AI. Check for mistakes.

echo "βœ… Railway deployment initiated successfully!"
echo "πŸ₯ Application will be available shortly at your Railway domain"
echo "πŸ“‹ Check Railway dashboard for deployment progress and URL"

- name: πŸ“’ Deployment Notification
if: always()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: |
πŸš€ NeuroBank FastAPI Banking System
πŸ“Š Deployment Status: ${{ job.status }}
🌟 Branch: ${{ github.ref }}
πŸ‘€ Author: ${{ github.actor }}
πŸ”— Commit: ${{ github.sha }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
echo "πŸš€ NeuroBank FastAPI Banking System"
echo "πŸ“Š Deployment Status: ${{ job.status }}"
echo "🌟 Branch: ${{ github.ref }}"
echo "πŸ‘€ Author: ${{ github.actor }}"
echo "πŸ”— Commit: ${{ github.sha }}"
echo "βœ… Deployment notification completed"

# ============================================================================
# 7. POST-DEPLOYMENT MONITORING
Expand Down