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
64 changes: 60 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,43 @@ jobs:
node-version: 20

- name: Install Vercel CLI
run: npm install -g vercel
run: npm install -g vercel@25.1.0

- name: Link Vercel project
working-directory: app
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
run: |
vercel link \
--project knowledge-copilot \
--scope "$VERCEL_SCOPE" \
--confirm \
--token "$VERCEL_TOKEN"

- name: Deploy frontend (Vercel)
working-directory: app
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
run: |
npx vercel@25.1.0 deploy --confirm --token "$VERCEL_TOKEN" --scope "$VERCEL_SCOPE" --name knowledge-copilot
attempt=1
max_attempts=3
while :; do
if vercel deploy --confirm --token "$VERCEL_TOKEN" --scope "$VERCEL_SCOPE"; then
break
fi

if [ "$attempt" -ge "$max_attempts" ]; then
echo "Vercel deploy failed after ${max_attempts} attempt(s)."
exit 1
fi

sleep_seconds=$((attempt * 10))
echo "Vercel deploy failed. Retry ${attempt}/${max_attempts} in ${sleep_seconds}s..."
sleep "$sleep_seconds"
attempt=$((attempt + 1))
done

- name: Setup Node.js for Railway CLI
uses: actions/setup-node@v4
Expand Down Expand Up @@ -113,15 +141,43 @@ jobs:
node-version: 20

- name: Install Vercel CLI
run: npm install -g vercel
run: npm install -g vercel@25.1.0

- name: Link Vercel project
working-directory: app
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
run: |
vercel link \
--project knowledge-copilot \
--scope "$VERCEL_SCOPE" \
--confirm \
--token "$VERCEL_TOKEN"

- name: Deploy frontend (Vercel)
working-directory: app
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_SCOPE: ${{ secrets.VERCEL_SCOPE }}
run: |
npx vercel@25.1.0 deploy --prod --confirm --token "$VERCEL_TOKEN" --scope "$VERCEL_SCOPE" --name knowledge-copilot
attempt=1
max_attempts=3
while :; do
if vercel deploy --prod --confirm --token "$VERCEL_TOKEN" --scope "$VERCEL_SCOPE"; then
break
fi

if [ "$attempt" -ge "$max_attempts" ]; then
echo "Vercel deploy failed after ${max_attempts} attempt(s)."
exit 1
fi

sleep_seconds=$((attempt * 10))
echo "Vercel deploy failed. Retry ${attempt}/${max_attempts} in ${sleep_seconds}s..."
sleep "$sleep_seconds"
attempt=$((attempt + 1))
done

- name: Setup Node.js for Railway CLI
uses: actions/setup-node@v4
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ docker compose up --build
### GitHub Actions 설정 항목
`Settings > Secrets and variables > Actions`에 아래 값이 있어야 합니다.
- `VERCEL_TOKEN`
- `VERCEL_ORG_ID`
- `VERCEL_PROJECT_ID`
- `VERCEL_SCOPE`
- `RAILWAY_TOKEN`
- `RAILWAY_SERVICE_NAME`
- `RAILWAY_DEV_ENVIRONMENT`
Expand Down