Skip to content

Commit 09348e4

Browse files
AI Testing MCPclaude
andcommitted
Add GitHub Actions for automated Railway deployment
- CI/CD pipeline with automatic deployment on push to master - Multi-Node.js version testing (18.x, 20.x) - TypeScript build validation and linting - Complete deployment guide with Railway integration - Auto-deploy triggers on every code push 🚀 Enables continuous deployment for always-on MCP server 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1cec5da commit 09348e4

File tree

3 files changed

+226
-0
lines changed

3 files changed

+226
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Deploy to Railway
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Use Node.js 18
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build application
27+
run: npm run build
28+
29+
- name: Run tests (if any)
30+
run: npm test --if-present
31+
32+
- name: Deploy to Railway
33+
uses: railwayapp/cli@v3
34+
with:
35+
command: deploy
36+
env:
37+
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
38+
39+
- name: Deploy Status
40+
if: success()
41+
run: |
42+
echo "✅ Deployment successful!"
43+
echo "🚀 AI Testing MCP Server is now live on Railway"

.github/workflows/test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI Tests
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build TypeScript
31+
run: npm run build
32+
33+
- name: Check for TypeScript errors
34+
run: npx tsc --noEmit
35+
36+
- name: Lint code
37+
run: |
38+
if [ -f .eslintrc.js ] || [ -f .eslintrc.json ]; then
39+
npm run lint --if-present
40+
else
41+
echo "No ESLint config found, skipping lint"
42+
fi
43+
44+
- name: Run tests
45+
run: npm test --if-present
46+
47+
- name: Build success notification
48+
if: success()
49+
run: |
50+
echo "✅ Build and tests passed!"
51+
echo "📦 TypeScript compiled successfully"
52+
echo "🔍 No lint errors found"

DEPLOYMENT.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Deployment Guide
2+
3+
## Automated Deployment with GitHub Actions
4+
5+
This repository includes automated deployment to Railway via GitHub Actions.
6+
7+
### Setup Steps
8+
9+
#### 1. Get Railway Token
10+
1. Go to [Railway Dashboard](https://railway.app/dashboard)
11+
2. Click your profile → **Account Settings**
12+
3. Go to **Tokens** tab
13+
4. Create new token → Copy the token
14+
15+
#### 2. Add GitHub Secret
16+
1. Go to your GitHub repo: https://github.com/Twisted66/ai-testing-mcp
17+
2. Go to **Settings****Secrets and variables****Actions**
18+
3. Click **New repository secret**
19+
4. Name: `RAILWAY_TOKEN`
20+
5. Value: Paste your Railway token
21+
6. Click **Add secret**
22+
23+
#### 3. Create Railway Project
24+
1. Go to [Railway Dashboard](https://railway.app/dashboard)
25+
2. Click **New Project**
26+
3. Select **Deploy from GitHub repo**
27+
4. Choose `Twisted66/ai-testing-mcp`
28+
5. Railway will create the project and give you a URL
29+
30+
#### 4. Auto-Deploy Setup Complete!
31+
Now every time you push to `master` branch:
32+
- GitHub Actions runs tests
33+
- Builds the TypeScript
34+
- Deploys to Railway automatically
35+
- Your MCP server updates instantly
36+
37+
### Manual Deployment (Alternative)
38+
39+
If you prefer manual deployment:
40+
41+
#### Option 1: Railway Web Dashboard
42+
1. Go to [railway.app](https://railway.app)
43+
2. Login with GitHub
44+
3. **New Project****Deploy from GitHub repo**
45+
4. Select `Twisted66/ai-testing-mcp`
46+
5. Railway auto-deploys
47+
48+
#### Option 2: Railway CLI (if available)
49+
```bash
50+
# Install Railway CLI
51+
npm install -g @railway/cli
52+
53+
# Login
54+
railway login
55+
56+
# Deploy
57+
railway up
58+
```
59+
60+
### Environment Variables
61+
62+
Railway automatically sets:
63+
- `NODE_ENV=production`
64+
- `PORT` (Railway provides this)
65+
66+
### Monitoring Deployment
67+
68+
#### GitHub Actions
69+
- Go to **Actions** tab in your repo
70+
- Watch the deployment progress
71+
- Green checkmark = successful deployment
72+
73+
#### Railway Dashboard
74+
- View logs in Railway dashboard
75+
- Monitor server health
76+
- Get deployment URL
77+
78+
### Claude Code Configuration
79+
80+
Once deployed, update your Claude Code config:
81+
82+
```json
83+
{
84+
"mcpServers": {
85+
"ai-testing": {
86+
"command": "node",
87+
"args": ["dist/index.js"],
88+
"transport": {
89+
"type": "http",
90+
"url": "https://your-project-name.up.railway.app"
91+
}
92+
}
93+
}
94+
}
95+
```
96+
97+
Replace `your-project-name.up.railway.app` with your actual Railway URL.
98+
99+
### Troubleshooting
100+
101+
#### Build Fails
102+
- Check GitHub Actions logs
103+
- Ensure `package.json` has correct scripts
104+
- Verify TypeScript compiles locally
105+
106+
#### Deployment Fails
107+
- Check `RAILWAY_TOKEN` secret is set correctly
108+
- Verify Railway project exists
109+
- Check Railway logs for errors
110+
111+
#### MCP Server Not Responding
112+
- Verify Railway URL is correct in Claude Code config
113+
- Check Railway logs for runtime errors
114+
- Test server endpoint directly: `curl https://your-url/health`
115+
116+
### Adding Health Check
117+
118+
The server includes a basic health check. Test with:
119+
```bash
120+
curl https://your-railway-url.up.railway.app/health
121+
```
122+
123+
Should return server status and available tools.
124+
125+
## Success! 🎉
126+
127+
Your AI Testing MCP server is now:
128+
- ✅ Auto-deployed on every code push
129+
- ✅ Always-on and globally accessible
130+
- ✅ Monitored with GitHub Actions
131+
- ✅ Ready for Claude Code integration

0 commit comments

Comments
 (0)