Merge pull request #163 from TEAM-COMFIT/feat/#154/bookmark-page #596
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: ci | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| branches: [main, dev] | |
| permissions: | |
| contents: read # μ½λ μ½κΈ° κΆν | |
| pull-requests: write # μλλ¦¬λ·°μ΄ μ€μ μ μν μ°κΈ° κΆν | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # μ μ₯μ μ½λ λ€μ΄λ‘λ | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| # pnpm μ€μΉ | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| # pnpm store μΊμ± | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('pnpm-lock.yaml') }} | |
| restore-keys: ${{ runner.os }}-pnpm- | |
| # node.js νκ²½ μ€μ | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: "24.x" | |
| # λΌμ΄λΈλ¬λ¦¬ μ€μΉ | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # νλ‘μ νΈ λ¦°νΈ κ²μ¬ λ° νμ κ²μ¬ | |
| - name: Check project | |
| id: check_step | |
| run: pnpm run lint && pnpm exec tsc --noEmit | |
| continue-on-error: true | |
| # νλ‘μ νΈ λΉλ | |
| - name: Build project | |
| id: build_step | |
| run: pnpm run build | |
| continue-on-error: true | |
| # λΉλ κ²°κ³Ό | |
| - name: Output build result | |
| if: github.event_name == 'pull_request' && always() | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| header: build-result | |
| message: | | |
| ### π λΉλ κ²°κ³Ό | |
| ${{ steps.check_step.outcome == 'success' && 'β **λ¦°νΈ κ²μ¬ μλ£**' || 'β **λ¦°νΈ κ²μ¬ μ€ν¨**'}} | |
| ${{ steps.build_step.outcome == 'success' && 'β **λΉλ μ±κ³΅**' || 'β **λΉλ μ€ν¨**' }} | |
| <details> | |
| <summary>λ‘κ·Έ νμΈνκΈ°</summary> | |
| <br> | |
| <a href="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"> | |
| Actions νμμ μμΈν 보기 | |
| </a> | |
| </details> | |
| # λΉλ κ²°κ³Ό λμ€μ½λ μλ 보λ΄κΈ° | |
| - name: Notify Discord Alarm | |
| if: github.event_name == 'pull_request' && always() | |
| run: | | |
| PR_TITLE="${{ github.event.pull_request.title }}" | |
| PR_USER="${{ github.event.pull_request.user.login }}" | |
| PR_URL="${{ github.event.pull_request.html_url }}" | |
| if [ "${{ steps.build_step.outcome }}" == "success" ]; then | |
| COLOR=3066993 | |
| TITLE="β λΉλ μ±κ³΅" | |
| else | |
| COLOR=15158332 | |
| TITLE="β λΉλ μ€ν¨" | |
| fi | |
| DESCRIPTION="**π Title :** \`$PR_TITLE\`\n **π€μμ±μ :** \`$PR_USER\`\n\n**[π PR보λ¬κ°κΈ°]($PR_URL)**" | |
| curl -H "Content-Type: application/json" \ | |
| -d "{ | |
| \"embeds\": [{ | |
| \"title\": \"$TITLE\", | |
| \"description\": \"$DESCRIPTION\", | |
| \"color\": $COLOR | |
| }] | |
| }" \ | |
| "${{ secrets.DISCORD_WEBHOOK_URL }}" | |
| # λΉλ μ€ν¨ μ, μ’ λ£ | |
| - name: Check Build Status | |
| if: steps.check_step.outcome == 'failure' || steps.build_step.outcome == 'failure' | |
| run: exit 1 | |
| assign: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: auto-assign-author-and-reviewer | |
| if: github.event_name == 'pull_request' && github.event.action == 'opened' | |
| uses: hkusu/review-assign-action@v1 | |
| with: | |
| assignees: ${{github.actor}} # λ΄λΉμ μ€μ | |
| reviewers: hummingbbird, odukong, u-zzn, qowjdals23 |