Skip to content

Commit dc36501

Browse files
StopDragonclaude
andcommitted
chore: Add deploy guide and workflow concurrency
- docs/DEPLOY.md: 서버 배포 및 클라이언트 빌드 명령어 정리 - build.yml: concurrency 설정 추가 (새 커밋 시 이전 실행 취소) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bd40be5 commit dc36501

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
branches: [main]
99
workflow_dispatch:
1010

11+
# 같은 브랜치/PR에서 새 커밋이 오면 이전 실행 취소
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1116
jobs:
1217
build-macos:
1318
runs-on: macos-latest

docs/DEPLOY.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# 배포 가이드
2+
3+
## 서버 배포 (텔레메트리 API)
4+
5+
### 서버 정보
6+
- 위치: `/opt/telemetry`
7+
- 서비스: `telemetry.service`
8+
- 포트: `8000` (systemd에서 `Environment=PORT=8000` 설정)
9+
10+
### 배포 명령어
11+
12+
```bash
13+
cd /opt/telemetry
14+
rm -rf temp
15+
git clone https://github.com/StopDragon/sword-macro-ai.git temp
16+
cd temp && go build -ldflags="-s -w" -o ../sword-api ./cmd/sword-api && cd ..
17+
rm -rf temp
18+
systemctl restart telemetry
19+
```
20+
21+
### 서비스 관리
22+
23+
```bash
24+
# 상태 확인
25+
systemctl status telemetry
26+
27+
# 로그 확인
28+
journalctl -u telemetry -f
29+
30+
# 재시작
31+
systemctl restart telemetry
32+
33+
# 중지
34+
systemctl stop telemetry
35+
```
36+
37+
### systemd 설정 (/etc/systemd/system/telemetry.service)
38+
39+
```ini
40+
[Service]
41+
Type=simple
42+
User=root
43+
WorkingDirectory=/opt/telemetry
44+
ExecStart=/opt/telemetry/sword-api
45+
Environment=PORT=8000
46+
Restart=always
47+
RestartSec=5
48+
```
49+
50+
---
51+
52+
## 클라이언트 빌드
53+
54+
### macOS (ARM64)
55+
```bash
56+
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o builds/sword-macro-darwin-arm64 ./cmd/sword-macro
57+
```
58+
59+
### macOS (AMD64)
60+
```bash
61+
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o builds/sword-macro-darwin-amd64 ./cmd/sword-macro
62+
```
63+
64+
### Windows (AMD64)
65+
```bash
66+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o builds/sword-macro-windows-amd64.exe ./cmd/sword-macro
67+
```
68+
69+
### 전체 빌드 (로컬)
70+
```bash
71+
# macOS ARM64 (네이티브)
72+
CGO_ENABLED=1 go build -ldflags="-s -w" -o builds/sword-macro-darwin-arm64 ./cmd/sword-macro
73+
74+
# macOS AMD64
75+
CGO_ENABLED=1 GOARCH=amd64 go build -ldflags="-s -w" -o builds/sword-macro-darwin-amd64 ./cmd/sword-macro
76+
77+
# Windows (CGO 비활성화)
78+
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o builds/sword-macro-windows-amd64.exe ./cmd/sword-macro
79+
```
80+
81+
---
82+
83+
*마지막 업데이트: 2026-02-04 (v2.5.1)*

0 commit comments

Comments
 (0)