- GITHUB_SERVER_URL은 https://github.com으로 고정되어 클론 실패 - http://gitea:3000 (Docker 내부 네트워크)으로 직접 지정 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
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
|
|
run: |
|
|
git clone --depth=1 --branch=${GITHUB_REF_NAME} \
|
|
http://gitea:3000/${GITHUB_REPOSITORY}.git .
|
|
|
|
- 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
|
|
run: |
|
|
cp target/gc-guide-api-*.jar /deploy/api/app.jar
|
|
date '+%Y-%m-%d %H:%M:%S' > /deploy/api/.deploy-trigger
|
|
echo "Deployed at $(cat /deploy/api/.deploy-trigger)"
|
|
ls -la /deploy/api/
|