Skip to content
Merged
Show file tree
Hide file tree
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
42 changes: 12 additions & 30 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,15 @@ jobs:
attempt=$((attempt + 1))
done

- name: Setup Node.js for Railway CLI
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Railway CLI
run: npm install -g @railway/cli

- name: Deploy API (Railway)
- name: Trigger API deployment (Railway)
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
working-directory: api
RAILWAY_DEPLOY_HOOK: ${{ secrets.RAILWAY_DEV_DEPLOY_HOOK }}
run: |
if [ -z "${{ secrets.RAILWAY_DEV_ENVIRONMENT }}" ]; then
echo "RAILWAY_DEV_ENVIRONMENT secret not configured." >&2
if [ -z "$RAILWAY_DEPLOY_HOOK" ]; then
echo "RAILWAY_DEV_DEPLOY_HOOK secret is not configured." >&2
exit 1
fi
railway up --service "${{ secrets.RAILWAY_SERVICE_NAME }}" \
--environment "${{ secrets.RAILWAY_DEV_ENVIRONMENT }}" \
--ci --detach
curl -fsSL -X POST "$RAILWAY_DEPLOY_HOOK"

deploy-production:
if: github.ref == 'refs/heads/main'
Expand Down Expand Up @@ -179,19 +168,12 @@ jobs:
attempt=$((attempt + 1))
done

- name: Setup Node.js for Railway CLI
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install Railway CLI
run: npm install -g @railway/cli

- name: Deploy API (Railway)
- name: Trigger API deployment (Railway)
env:
RAILWAY_TOKEN: ${{ secrets.RAILWAY_TOKEN }}
working-directory: api
RAILWAY_DEPLOY_HOOK: ${{ secrets.RAILWAY_PROD_DEPLOY_HOOK }}
run: |
railway up --service "${{ secrets.RAILWAY_SERVICE_NAME }}" \
--environment production \
--ci --detach
if [ -z "$RAILWAY_DEPLOY_HOOK" ]; then
echo "RAILWAY_PROD_DEPLOY_HOOK secret is not configured." >&2
exit 1
fi
curl -fsSL -X POST "$RAILWAY_DEPLOY_HOOK"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,10 @@ npm run build

- `VERCEL_TOKEN`
- `VERCEL_SCOPE`
- `RAILWAY_TOKEN`
- `RAILWAY_SERVICE_NAME`
- `RAILWAY_DEV_ENVIRONMENT`
- `RAILWAY_DEV_DEPLOY_HOOK`
- `RAILWAY_PROD_DEPLOY_HOOK`

Railway 배포는 더 이상 `RAILWAY_TOKEN`을 사용하지 않고, GitHub Actions에서 각 환경별 Deploy Hook URL을 호출해 배포를 트리거합니다.

---

Expand Down
14 changes: 7 additions & 7 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bash ./scripts/check-deploy-env.sh
- Vercel Web
- `NEXT_PUBLIC_API_BASE`
- 로컬 토큰 관리
- `VERCEL_TOKEN`, `RAILWAY_TOKEN`, `GITHUB_TOKEN` (로컬 용도)
- `VERCEL_TOKEN`, `GITHUB_TOKEN` (로컬 용도)

## Git 기반 자동 배포 흐름

Expand All @@ -67,15 +67,15 @@ bash ./scripts/check-deploy-env.sh
### 필요한 GitHub Actions 시크릿
- `VERCEL_TOKEN`
- `VERCEL_SCOPE` (`doublesilvers-projects`)
- `RAILWAY_TOKEN`
- `RAILWAY_SERVICE_NAME`
- `RAILWAY_DEV_ENVIRONMENT`
- `RAILWAY_DEV_DEPLOY_HOOK`
- `RAILWAY_PROD_DEPLOY_HOOK`

현재 저장소 기준으로 확정된 값
- `VERCEL_SCOPE=doublesilvers-projects`
- `RAILWAY_SERVICE_NAME=knowledge-copilot-api`
- `RAILWAY_DEV_ENVIRONMENT=development`
- `RAILWAY_TOKEN`은 유효한 CLI 토큰으로 교체 필요

Railway 배포는 더 이상 CLI 토큰(`RAILWAY_TOKEN`)을 사용하지 않고, GitHub Actions에서 각 환경별 **Deploy Hook URL**(`RAILWAY_DEV_DEPLOY_HOOK`, `RAILWAY_PROD_DEPLOY_HOOK`)을 POST 호출해 트리거합니다.

참고: Deploy Hook URL은 Railway 프로젝트 Settings → Deployments → Deployment Hooks 에서 발급합니다.

## 운영 주의

Expand Down
1 change: 0 additions & 1 deletion scripts/check-deploy-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ require_var NEXT_PUBLIC_API_BASE
echo
echo "== Deployment tooling tokens (local) =="
warn_var VERCEL_TOKEN
warn_var RAILWAY_TOKEN
warn_var GITHUB_TOKEN

if [ "$failures" -ne 0 ]; then
Expand Down