Update README.md #265
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
| name: Preview ๋ฐฐํฌ | |
| env: | |
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| Deploy-Preview: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: ์ ์ฅ์ ์ฒดํฌ์์ | |
| uses: actions/checkout@v4 | |
| - name: Node.js ํ๊ฒฝ ์ค์ | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: pnpm ์ค์น | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: latest | |
| - name: pnpm ์บ์ ์ค์ | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: ์์กด์ฑ ์ค์น | |
| run: pnpm install --frozen-lockfile | |
| - name: ํ์ ์ฒดํฌ | |
| run: pnpm run type-check | |
| continue-on-error: true | |
| - name: ๋ฆฐํธ ๊ฒ์ฌ | |
| run: pnpm run lint | |
| continue-on-error: true | |
| - name: ํ ์คํธ ์คํ | |
| run: pnpm run test | |
| continue-on-error: true | |
| - name: Vercel CLI ์ค์น | |
| run: pnpm add --global vercel@latest | |
| - name: Vercel ํ๊ฒฝ ์ ๋ณด ๊ฐ์ ธ์ค๊ธฐ (Preview) | |
| run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: ํ๋ก์ ํธ ๋น๋ | |
| run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Vercel์ Preview ๋ฐฐํฌ | |
| id: deploy | |
| run: | | |
| url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) | |
| echo "PREVIEW_URL=$url" >> $GITHUB_OUTPUT | |
| echo "๐ Preview ๋ฐฐํฌ ์๋ฃ!" | |
| echo "Preview URL: $url" | |
| - name: ๋ฐฐํฌ ๊ฒฐ๊ณผ PR ์ฝ๋ฉํธ | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const { PREVIEW_URL } = process.env; | |
| const comment = ` | |
| ## ๐ Preview ๋ฐฐํฌ ์๋ฃ! | |
| **Preview URL:** ${PREVIEW_URL} | |
| **๋ฐฐํฌ ๋ธ๋์น:** \`${{ github.ref_name }}\` | |
| **์ปค๋ฐ:** \`${{ github.sha }}\` | |
| ๋ฐฐํฌ๋ ์ฌ์ดํธ์์ ๋ณ๊ฒฝ์ฌํญ์ ํ์ธํด๋ณด์ธ์! โจ | |
| `; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: comment | |
| }) | |
| env: | |
| PREVIEW_URL: ${{ steps.deploy.outputs.PREVIEW_URL }} | |
| - name: ๋ฐฐํฌ ์ฑ๊ณต ์๋ฆผ | |
| if: success() | |
| run: | | |
| echo "โ Preview ํ๊ฒฝ์ ์ฑ๊ณต์ ์ผ๋ก ๋ฐฐํฌ๋์์ต๋๋ค!" |