platform-knowledge
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePlatform Knowledge Skill
平台知识技能
Overview
概述
This skill provides comprehensive knowledge of the infrastructure platforms: GitHub Actions, Railway, Supabase, and Postgres. It covers architecture, configuration, troubleshooting, and best practices for each platform.
本技能提供GitHub Actions、Railway、Supabase和Postgres这些基础设施平台的全面知识,涵盖每个平台的架构、配置、故障排查及最佳实践。
Platform Overview
平台概览
GitHub Actions
GitHub Actions
- Purpose: CI/CD automation
- Key Features: Workflow automation, testing, deployment
- Config Files:
.github/workflows/*.yml - CLI:
gh
- 用途:CI/CD自动化
- 核心特性:工作流自动化、测试、部署
- 配置文件:
.github/workflows/*.yml - 命令行工具:
gh
Railway
Railway
- Purpose: Application hosting and deployment
- Key Features: Auto-deployments, instant rollbacks, environment management
- Config Files: ,
railway.toml,nixpacks.tomlProcfile - CLI:
railway
- 用途:应用托管与部署
- 核心特性:自动部署、即时回滚、环境管理
- 配置文件:,
railway.toml,nixpacks.tomlProcfile - 命令行工具:
railway
Supabase
Supabase
- Purpose: Backend-as-a-Service (Postgres, Auth, Storage, Realtime)
- Key Features: Managed Postgres, authentication, file storage, realtime subscriptions
- Config Files: , migrations
supabase/config.toml - Access: MCP tools, Dashboard, CLI
- 用途:后端即服务(包含Postgres、身份验证、存储、实时功能)
- 核心特性:托管式Postgres、身份验证、文件存储、实时订阅
- 配置文件:、迁移文件
supabase/config.toml - 访问方式:MCP工具、控制台、命令行工具
Postgres
Postgres
- Purpose: Relational database
- Key Features: ACID compliance, extensions, full-text search, JSON support
- Config: Connection strings, postgresql.conf
- Access: SQL queries via MCP or psql
- 用途:关系型数据库
- 核心特性:ACID合规、扩展功能、全文搜索、JSON支持
- 配置项:连接字符串、postgresql.conf
- 访问方式:通过MCP或psql执行SQL查询
Platform Interaction Map
平台交互图
┌──────────────┐ ┌──────────────┐
│ GitHub │ │ Railway │
│ Actions │────▶│ (App) │
│ (CI/CD) │ │ │
└──────────────┘ └──────┬───────┘
│
▼
┌──────────────┐
│ Supabase │
│ (Backend) │
│ │
│ ┌──────────┐ │
│ │ Postgres │ │
│ └──────────┘ │
└──────────────┘┌──────────────┐ ┌──────────────┐
│ GitHub │ │ Railway │
│ Actions │────▶│ (App) │
│ (CI/CD) │ │ │
└──────────────┘ └──────┬───────┘
│
▼
┌──────────────┐
│ Supabase │
│ (Backend) │
│ │
│ ┌──────────┐ │
│ │ Postgres │ │
│ └──────────┘ │
└──────────────┘Quick Reference
快速参考
Tool Access by Platform
各平台工具访问方式
| Platform | MCP Tools | CLI | Logs |
|---|---|---|---|
| GitHub Actions | No | | |
| Railway | No | | |
| Supabase | Yes | | MCP |
| Postgres | Yes (via Supabase) | | MCP |
| 平台 | MCP工具 | 命令行工具 | 日志 |
|---|---|---|---|
| GitHub Actions | 无 | | |
| Railway | 无 | | |
| Supabase | 有 | | MCP |
| Postgres | 有(通过Supabase) | | MCP |
Common Operations
常见操作
| Task | GitHub | Railway | Supabase |
|---|---|---|---|
| Deploy | Push/workflow | Git push / | Dashboard / CLI |
| Logs | | | MCP |
| Status | | | MCP |
| Rollback | Re-run workflow | Dashboard | Run migration down |
| Secrets | Repository settings | Environment variables | Project settings |
| 任务 | GitHub Actions | Railway | Supabase |
|---|---|---|---|
| 部署 | 推送/工作流 | Git推送 / | 控制台 / 命令行工具 |
| 查看日志 | | | MCP |
| 查看状态 | | | MCP |
| 回滚 | 重新运行工作流 | 控制台 | 执行回滚迁移 |
| 密钥管理 | 仓库设置 | 环境变量 | 项目设置 |
Troubleshooting Decision Tree
故障排查决策树
Issue Reported
│
▼
┌─────────────────────────────────────┐
│ Where does the issue manifest? │
└─────────────────────────────────────┘
│
├─► Build/Deploy fails ──► GitHub Actions / Railway
│
├─► API errors ──► Supabase API / Edge Functions
│
├─► Auth issues ──► Supabase Auth
│
├─► Database errors ──► Postgres
│
├─► App crashes ──► Railway / Edge Functions
│
└─► Performance ──► All platforms (profile each)问题上报
│
▼
┌─────────────────────────────────────┐
│ 问题出现在哪个环节? │
└─────────────────────────────────────┘
│
├─► 构建/部署失败 ──► GitHub Actions / Railway
│
├─► API错误 ──► Supabase API / 边缘函数
│
├─► 身份验证问题 ──► Supabase Auth
│
├─► 数据库错误 ──► Postgres
│
├─► 应用崩溃 ──► Railway / 边缘函数
│
└─► 性能问题 ──► 所有平台(逐一分析)Platform-Specific Guides
各平台详细指南
Detailed guides for each platform:
- GitHub Actions - CI/CD workflows, secrets, debugging
- Railway - Deployment, configuration, troubleshooting
- Supabase - Auth, API, Realtime, Storage
- Postgres - Queries, performance, administration
每个平台的详细指南:
- GitHub Actions - CI/CD工作流、密钥、调试
- Railway - 部署、配置、故障排查
- Supabase - 身份验证、API、实时功能、存储
- Postgres - 查询、性能优化、管理
Cross-Platform Issues
跨平台问题
Deployment Chain Failure
部署链故障
Symptom: Deploy succeeds but app broken
Check all stages:
- GitHub Actions - Build/test passed?
- Railway - Deploy successful?
- Supabase - Migrations applied?
- Environment - Variables set?
症状:部署成功但应用无法正常运行
检查所有环节:
- GitHub Actions - 构建/测试是否通过?
- Railway - 部署是否成功?
- Supabase - 迁移是否已应用?
- 环境 - 变量是否已设置?
Environment Variable Issues
环境变量问题
Common causes:
- Set in wrong environment
- Typo in variable name
- Not propagated after change
Verify across platforms:
bash
undefined常见原因:
- 在错误环境中设置
- 变量名称拼写错误
- 修改后未同步
跨平台验证:
bash
undefinedGitHub Actions - Check secrets
GitHub Actions - 检查密钥
(Can't view, only verify existence)
(无法查看,仅能验证是否存在)
Railway
Railway
railway variables
railway variables
Supabase - Check project settings
Supabase - 检查项目设置
Dashboard or MCP
控制台或MCP
undefinedundefinedConnection Issues Between Services
服务间连接问题
Railway → Supabase:
- Check Supabase URL format
- Verify API key (anon vs service_role)
- Check connection pooling settings
- Verify IP restrictions
GitHub Actions → Services:
- Check secrets are accessible
- Verify network egress allowed
- Check for rate limiting
Railway → Supabase:
- 检查Supabase URL格式
- 验证API密钥(anon vs service_role)
- 检查连接池设置
- 验证IP限制
GitHub Actions → 服务:
- 检查密钥是否可访问
- 验证网络出口是否允许
- 检查是否存在速率限制
Performance Troubleshooting Matrix
性能故障排查矩阵
| Symptom | GitHub Actions | Railway | Supabase | Postgres |
|---|---|---|---|---|
| Slow | Cache missing, big deps | Cold start, resources | Edge function | Query optimization |
| Timeout | Step timeout | Health check | API timeout | Statement timeout |
| Memory | OOM on build | Container limit | Function limit | work_mem |
| CPU | Concurrent jobs | Container limit | N/A | Query complexity |
| 症状 | GitHub Actions | Railway | Supabase | Postgres |
|---|---|---|---|---|
| 运行缓慢 | 缓存缺失、依赖包过大 | 冷启动、资源限制 | 边缘函数 | 查询优化 |
| 超时 | 步骤超时 | 健康检查 | API超时 | 语句超时 |
| 内存问题 | 构建时内存溢出 | 容器资源限制 | 函数资源限制 | work_mem配置 |
| CPU问题 | 并发作业 | 容器资源限制 | 无 | 查询复杂度 |
Configuration Files Reference
配置文件参考
GitHub Actions
GitHub Actions
yaml
undefinedyaml
undefined.github/workflows/deploy.yml
.github/workflows/deploy.yml
name: Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ... more steps
undefinedname: Deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ... 更多步骤
undefinedRailway
Railway
toml
undefinedtoml
undefinedrailway.toml
railway.toml
[build]
builder = "nixpacks"
buildCommand = "npm run build"
[deploy]
startCommand = "npm start"
healthcheckPath = "/health"
undefined[build]
builder = "nixpacks"
buildCommand = "npm run build"
[deploy]
startCommand = "npm start"
healthcheckPath = "/health"
undefinedSupabase
Supabase
toml
undefinedtoml
undefinedsupabase/config.toml
supabase/config.toml
[api]
port = 54321
schemas = ["public", "graphql_public"]
[db]
port = 54322
undefined[api]
port = 54321
schemas = ["public", "graphql_public"]
[db]
port = 54322
undefinedPostgres
Postgres
sql
-- Key settings
SHOW max_connections;
SHOW statement_timeout;
SHOW work_mem;sql
-- 关键配置
SHOW max_connections;
SHOW statement_timeout;
SHOW work_mem;