diff --git a/.gitea/workflows/main-build.yml b/.gitea/workflows/main-build.yml index 8544d7a..ab3235c 100644 --- a/.gitea/workflows/main-build.yml +++ b/.gitea/workflows/main-build.yml @@ -2,55 +2,27 @@ name: Main-Build on: push: - branches: ["master"] + branches: ["master"] jobs: build-and-push: runs-on: ubuntu-latest - container: - image: ci-maven-node:1.0 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up JDK 8 - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: "8" + - uses: actions/checkout@v4 - name: Maven Build WAR run: mvn -B clean package -DskipTests - # ------------------------------ - # πŸ”» Harbor κ΄€λ ¨ κΈ°λŠ₯ μž„μ‹œ λΉ„ν™œμ„±ν™” - # ------------------------------ - - # - name: Docker login to Harbor - # run: | - # echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.sayinfo.co.kr -u ${{ secrets.HARBOR_USERNAME }} --password-stdin - - # - name: Build Docker image - # run: | - # docker build -t sayit-helpdesk:latest . - - # - name: Tag image for Harbor - # run: | - # docker tag sayit-helpdesk:latest harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest - - # - name: Push image to Harbor - # run: | - # docker push harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest - - # ------------------------------ - # 끝 (Harbor λΉ„ν™œμ„±ν™”) - # ------------------------------ - - - name: Build Docker image (local only, no push) + - name: Login Harbor run: | - docker build -t sayit-helpdesk:local-test . + echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.sayinfo.co.kr -u ${{ secrets.HARBOR_USERNAME }} --password-stdin - - name: Done - run: echo "Main branch build completed (Harbor push disabled)." + - name: Build Docker image + run: | + docker build -t sayit-helpdesk:latest . + + - name: Push to Harbor + run: | + docker tag sayit-helpdesk:latest harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest + docker push harbor.sayinfo.co.kr/helpdesk/helpdesk-service:latest diff --git a/.gitea/workflows/pr-ci.yml b/.gitea/workflows/pr-ci.yml index d30eae5..4210e1c 100644 --- a/.gitea/workflows/pr-ci.yml +++ b/.gitea/workflows/pr-ci.yml @@ -2,33 +2,15 @@ name: PR-CI on: pull_request: - types: [opened, synchronize] # PR 생성 + 컀밋 push λ•Œλ§Œ μ‹€ν–‰ - branches: ["master"] + types: [opened, synchronize] + branches: ["master"] jobs: build-test: runs-on: ubuntu-latest - container: - image: ci-maven-node:1.0 - steps: - - name: Checkout source - uses: actions/checkout@v4 + - 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: Maven Build (compile + dependency check) + - name: Maven Build (skip tests) run: mvn -B clean package -DskipTests