docs: CI/CD 가이드에 백엔드 배포 워크플로우 추가

- 배포 흐름도에 프론트엔드/백엔드 경로 분리
- gc-guide-api 워크플로우: Maven 빌드 + systemd 자동 재시작
- Maven 컨테이너에서 git clone 사용 (actions/checkout 대체)
- NEXUS_USERNAME/PASSWORD 시크릿 항목 추가
- 트러블슈팅: Maven 빌드 실패, API 서비스 재시작 미동작

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
htlee 2026-02-14 20:46:56 +09:00
부모 ff3a5ab82f
커밋 ceed340632

파일 보기

@ -44,10 +44,13 @@ export default function CiCdGuide() {
<span className="text-accent">Gitea Actions </span> &rarr; act_runner (Docker ) <span className="text-accent">Gitea Actions </span> &rarr; act_runner (Docker )
</p> </p>
<p className="pl-8">&darr;</p> <p className="pl-8">&darr;</p>
<p className="pl-4">npm ci &rarr; npm run build &rarr; dist/ </p>
<p className="pl-8">&darr;</p>
<p className="pl-4"> <p className="pl-4">
&rarr; <span className="text-success">Nginx </span> <strong>:</strong> npm ci &rarr; npm run build &rarr; dist/ &rarr;{' '}
<span className="text-success">Nginx </span>
</p>
<p className="pl-4">
<strong>:</strong> mvn package &rarr; app.jar &rarr; .deploy-trigger &rarr;{' '}
<span className="text-success">systemd </span>
</p> </p>
</div> </div>
</div> </div>
@ -189,6 +192,16 @@ jobs: # 실행할 작업 목록
<td className="px-4 py-3 text-text-secondary">Nexus npm (Base64)</td> <td className="px-4 py-3 text-text-secondary">Nexus npm (Base64)</td>
<td className="px-4 py-3 text-text-secondary">gc-guide</td> <td className="px-4 py-3 text-text-secondary">gc-guide</td>
</tr> </tr>
<tr>
<td className="px-4 py-3 font-mono text-text-primary">NEXUS_USERNAME</td>
<td className="px-4 py-3 text-text-secondary">Nexus Maven </td>
<td className="px-4 py-3 text-text-secondary">gc-guide-api</td>
</tr>
<tr>
<td className="px-4 py-3 font-mono text-text-primary">NEXUS_PASSWORD</td>
<td className="px-4 py-3 text-text-secondary">Nexus Maven </td>
<td className="px-4 py-3 text-text-secondary">gc-guide-api</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -246,14 +259,23 @@ jobs:
. Nginx가 . . Nginx가 .
</Alert> </Alert>
{/* gc-guide-api 워크플로우 예시 (향후) */} {/* gc-guide-api 워크플로우 예시 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4">gc-guide-api (Spring Boot, )</h2> <h2 className="text-xl font-bold text-text-primary mt-10 mb-4">gc-guide-api (Spring Boot)</h2>
<p className="text-text-secondary mb-4"> <p className="text-text-secondary mb-4">
Java/Spring Boot . gc-guide-api에 . gc-guide-api .
Maven , JAR .
systemd가 .
</p> </p>
<Alert type="warning">
Maven (<code className="bg-bg-tertiary px-1 rounded">maven:3.9-eclipse-temurin-17</code>) Node.js가 {' '}
<code className="bg-bg-tertiary px-1 rounded">actions/checkout@v4</code> .
<code className="bg-bg-tertiary px-1 rounded">git clone</code> .
</Alert>
<CodeBlock <CodeBlock
language="yaml" language="yaml"
filename=".gitea/workflows/deploy.yml (예정)" filename=".gitea/workflows/deploy.yml"
code={`name: Build and Deploy API code={`name: Build and Deploy API
on: on:
@ -268,12 +290,14 @@ jobs:
image: maven:3.9-eclipse-temurin-17 image: maven:3.9-eclipse-temurin-17
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 run: |
git clone --depth=1 --branch=\$\{GITHUB_REF_NAME\} \\
http://gitea:3000/\$\{GITHUB_REPOSITORY\}.git .
- name: Configure Maven (settings.xml) - name: Configure Maven settings
run: | run: |
mkdir -p ~/.m2 mkdir -p ~/.m2
cat > ~/.m2/settings.xml << 'EOF' cat > ~/.m2/settings.xml << 'SETTINGS'
<settings> <settings>
<mirrors> <mirrors>
<mirror> <mirror>
@ -290,17 +314,54 @@ jobs:
</server> </server>
</servers> </servers>
</settings> </settings>
EOF SETTINGS
- name: Build - name: Build
run: mvn clean package -DskipTests run: mvn clean package -DskipTests -B
- name: Deploy - name: Deploy
run: | run: |
cp target/*.jar /deploy/api/app.jar cp target/gc-guide-api-*.jar /deploy/api/app.jar
# `} date '+%Y-%m-%d %H:%M:%S' > /deploy/api/.deploy-trigger
echo "Deployed at $(date '+%Y-%m-%d %H:%M:%S')"
ls -la /deploy/api/`}
/> />
<Alert type="info">
<code className="bg-bg-tertiary px-1 rounded">/deploy/api/</code> act_runner
<code className="bg-bg-tertiary px-1 rounded">/devdata/services/guide/api/</code>
. <code className="bg-bg-tertiary px-1 rounded">.deploy-trigger</code>
systemd path watcher가 .
</Alert>
<h3 className="text-lg font-semibold text-text-primary mt-6 mb-3"> </h3>
<div className="bg-surface border border-border-default rounded-xl p-5 mb-6">
<div className="font-mono text-sm space-y-1 text-text-secondary">
<p>main &rarr; Gitea Actions &rarr; Maven </p>
<p className="pl-8">&darr;</p>
<p className="pl-4">
<code>app.jar</code> + <code>.deploy-trigger</code>
</p>
<p className="pl-8">&darr;</p>
<p className="pl-4">
<span className="text-accent">systemd path watcher</span> &rarr;{' '}
<code>gc-guide-api.service</code>
</p>
<p className="pl-8">&darr;</p>
<p className="pl-4">
<span className="text-success">Spring Boot </span> ( 8082, prod )
</p>
</div>
</div>
<h3 className="text-lg font-semibold text-text-primary mt-6 mb-3">Checkout </h3>
<p className="text-text-secondary mb-4">
Java <code className="bg-bg-tertiary px-1 rounded">container</code> Maven ,
job Node.js가 <code className="bg-bg-tertiary px-1 rounded">actions/checkout@v4</code>
. <code className="bg-bg-tertiary px-1 rounded">git clone</code> ,
Gitea (<code className="bg-bg-tertiary px-1 rounded">http://gitea:3000</code>)를 사용합니다.
</p>
{/* Actions 확인 */} {/* Actions 확인 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4"> </h2> <h2 className="text-xl font-bold text-text-primary mt-10 mb-4"> </h2>
<StepGuide <StepGuide
@ -483,6 +544,33 @@ cd /devdata/services && docker compose down && docker compose up -d`}
</ul> </ul>
</div> </div>
<div className="bg-surface border border-border-default rounded-xl p-5">
<h4 className="font-semibold text-text-primary mb-2">Maven </h4>
<ul className="list-disc list-inside text-text-secondary space-y-1 text-sm">
<li>NEXUS_USERNAME, NEXUS_PASSWORD 릿 </li>
<li>
<code className="bg-bg-tertiary px-1 rounded">container</code> {' '}
<code className="bg-bg-tertiary px-1 rounded">actions/checkout@v4</code> {' '}
<code className="bg-bg-tertiary px-1 rounded">git clone</code> (Node.js )
</li>
<li>
Checkout URL은 <code className="bg-bg-tertiary px-1 rounded">http://gitea:3000</code> 사용
(GITHUB_SERVER_URL은 github.com으로 )
</li>
<li>Nexus Maven (devnet )</li>
</ul>
</div>
<div className="bg-surface border border-border-default rounded-xl p-5">
<h4 className="font-semibold text-text-primary mb-2">API </h4>
<ul className="list-disc list-inside text-text-secondary space-y-1 text-sm">
<li>systemd path watcher : <code className="bg-bg-tertiary px-1 rounded">systemctl status gc-guide-api-watcher.path</code></li>
<li> : <code className="bg-bg-tertiary px-1 rounded">systemctl status gc-guide-api</code></li>
<li>.deploy-trigger : <code className="bg-bg-tertiary px-1 rounded">cat /devdata/services/guide/api/.deploy-trigger</code></li>
<li> : <code className="bg-bg-tertiary px-1 rounded">journalctl -u gc-guide-api -n 50</code></li>
</ul>
</div>
<div className="bg-surface border border-border-default rounded-xl p-5"> <div className="bg-surface border border-border-default rounded-xl p-5">
<h4 className="font-semibold text-text-primary mb-2"> </h4> <h4 className="font-semibold text-text-primary mb-2"> </h4>
<ul className="list-disc list-inside text-text-secondary space-y-1 text-sm"> <ul className="list-disc list-inside text-text-secondary space-y-1 text-sm">