Skip to content

Merge pull request #163 from TEAM-COMFIT/feat/#154/bookmark-page #596

Merge pull request #163 from TEAM-COMFIT/feat/#154/bookmark-page

Merge pull request #163 from TEAM-COMFIT/feat/#154/bookmark-page #596

Workflow file for this run

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