π§ config: add next-pwa & metadata [KOBG-5] #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |