PR생성시 메이븐 컴파일 및 의존성 에러 체크 메인브랜치에 병합시 빌드 및 war를 깃티와 넥서스 레포지토리에 업로드
This commit is contained in:
51
.gitea/workflows/main-build.yml
Normal file
51
.gitea/workflows/main-build.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Master-Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
|
||||
jobs:
|
||||
build-war:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "8"
|
||||
|
||||
- name: Cache Maven repo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: m2-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
m2-${{ runner.os }}-
|
||||
|
||||
- name: Configure Maven Settings for Nexus
|
||||
run: |
|
||||
mkdir -p ~/.m2
|
||||
cat > ~/.m2/settings.xml <<EOF
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>nexus</id>
|
||||
<username>${{ secrets.NEXUS_USERNAME }}</username>
|
||||
<password>${{ secrets.NEXUS_PASSWORD }}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
||||
EOF
|
||||
|
||||
- name: Maven deploy (WAR to Nexus)
|
||||
run: mvn -B clean deploy -DskipTests
|
||||
|
||||
- name: Upload WAR artifact (optional)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sayit-helpdesk-war
|
||||
path: target/sayit.helpdesk.war
|
||||
Reference in New Issue
Block a user