feat: CI/CD 자동 배포 워크플로우 추가
- .gitea/workflows/deploy.yml: main 머지 시 Maven 빌드 + JAR 배포 - container: maven:3.9-eclipse-temurin-17 이미지 사용 - Nexus Maven 프록시 설정 포함 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
부모
cc03aa14ff
커밋
e98efbd6e0
46
.gitea/workflows/deploy.yml
Normal file
46
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,46 @@
|
||||
name: Build and Deploy API
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: maven:3.9-eclipse-temurin-17
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure Maven settings
|
||||
run: |
|
||||
mkdir -p ~/.m2
|
||||
cat > ~/.m2/settings.xml << 'SETTINGS'
|
||||
<settings>
|
||||
<mirrors>
|
||||
<mirror>
|
||||
<id>nexus</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<url>https://nexus.gc-si.dev/repository/maven-public/</url>
|
||||
</mirror>
|
||||
</mirrors>
|
||||
<servers>
|
||||
<server>
|
||||
<id>nexus</id>
|
||||
<username>${{ secrets.NEXUS_USERNAME }}</username>
|
||||
<password>${{ secrets.NEXUS_PASSWORD }}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
SETTINGS
|
||||
|
||||
- name: Build
|
||||
run: mvn clean package -DskipTests -B
|
||||
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
cp target/gc-guide-api-*.jar /deploy/api/app.jar
|
||||
echo "Deployed at $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
ls -la /deploy/api/
|
||||
불러오는 중...
Reference in New Issue
Block a user