-
Notifications
You must be signed in to change notification settings - Fork 4
113 lines (102 loc) Β· 3.75 KB
/
ci.yml
File metadata and controls
113 lines (102 loc) Β· 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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