From 6b2197ef8ee2ab80b8f3d8eb0a915d3dfcfc7723 Mon Sep 17 00:00:00 2001 From: HYOJIN Date: Tue, 7 Apr 2026 11:28:39 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20Gitea=20Actions=20=EC=9E=90=EB=8F=99=20?= =?UTF-8?q?=EB=B0=B0=ED=8F=AC=20=EC=9B=8C=ED=81=AC=ED=94=8C=EB=A1=9C?= =?UTF-8?q?=EC=9A=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main 브랜치 push 시 자동 빌드 + 배포 - Frontend (npm) + Backend (Maven) 분리 빌드 - frontend.skip 프로퍼티로 CI에서 frontend-maven-plugin 스킵 지원 - 배포 경로: /deploy/snp-connection/app.jar Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/deploy.yml | 63 +++++++++++++++++++++++++++++++++++++ pom.xml | 2 ++ 2 files changed, 65 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..7470be7 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,63 @@ +name: Build and Deploy + +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' + + + + nexus + * + https://nexus.gc-si.dev/repository/maven-public/ + + + + + nexus + ${{ secrets.NEXUS_USERNAME }} + ${{ secrets.NEXUS_PASSWORD }} + + + + SETTINGS + + - name: Install Node.js + run: | + curl -fsSL https://deb.nodesource.com/setup_20.x | bash - + apt-get install -y nodejs + node --version + npm --version + + - name: Build Frontend + run: | + cd frontend + npm install + npm run build + cd .. + + - name: Build Backend + run: mvn clean package -DskipTests -Dfrontend.skip=true -B + + - name: Deploy + run: | + cp target/snp-connection-monitoring-*.jar /deploy/snp-connection/app.jar + date '+%Y-%m-%d %H:%M:%S' > /deploy/snp-connection/.deploy-trigger + echo "Deployed at $(cat /deploy/snp-connection/.deploy-trigger)" + ls -la /deploy/snp-connection/ diff --git a/pom.xml b/pom.xml index 1408c9f..c9d2cc6 100644 --- a/pom.xml +++ b/pom.xml @@ -28,6 +28,7 @@ 3.2.1 42.7.6 1.18.30 + false @@ -139,6 +140,7 @@ frontend v20.19.0 + ${frontend.skip}