Skip to content

✨ feat: add tts [KOBG-11] #12

✨ feat: add tts [KOBG-11]

✨ feat: add tts [KOBG-11] #12

Workflow file for this run

# CI: 빌드, 테스트 + PR Preview 배포 (PR에만)
name: CI
on:
pull_request:
branches: [main, develop]
push:
branches: [main, develop]
permissions:
pull-requests: write
issues: write
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_KOBRIDGE }}
jobs:
build-and-test:
runs-on: ubuntu-latest
outputs:
preview-url: ${{ steps.deploy.outputs.preview-url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
- name: Run type check
run: npm run type-check
- name: Build application
run: npm run build
# PR일 때만 Preview 배포
- name: Install Vercel CLI
if: github.event_name == 'pull_request'
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information
if: github.event_name == 'pull_request'
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN_KOBRIDGE }}
- name: Build Project Artifacts
if: github.event_name == 'pull_request'
run: vercel build --token=${{ secrets.VERCEL_TOKEN_KOBRIDGE }}
- name: Deploy Preview to Vercel
if: github.event_name == 'pull_request'
id: deploy
run: |
url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN_KOBRIDGE }})
echo "preview-url=$url" >> $GITHUB_OUTPUT
- name: Comment PR with Preview URL
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const url = '${{ steps.deploy.outputs.preview-url }}';
github.rest.issues.createComment({
issue_number: context.payload.pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🔍 Preview URL: ${url}`
})
- name: Add Preview URL to Summary
if: github.event_name == 'pull_request'
run: |
echo "## 🔍 Preview URL" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.deploy.outputs.preview-url }}" >> $GITHUB_STEP_SUMMARY