From f9092ff10d81a0f99bb2d9b6608772f607a10bdb Mon Sep 17 00:00:00 2001 From: bogdandina Date: Wed, 15 Oct 2025 11:06:00 +0300 Subject: [PATCH 1/3] feat(62035): implement ci-cd-java.yml --- .github/workflows/ci-cd-java.yml | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/ci-cd-java.yml diff --git a/.github/workflows/ci-cd-java.yml b/.github/workflows/ci-cd-java.yml new file mode 100644 index 0000000..208e5e6 --- /dev/null +++ b/.github/workflows/ci-cd-java.yml @@ -0,0 +1,84 @@ +name: ci-cd-java.yml +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + merge_group: + +jobs: + build-check-test-push: + name: Build, check, test, push + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + clean: 'true' + fetch-depth: 2 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' + + - name: Check code format and lint + run: | + mvn spotless:check + + - name: Run tests + run: mvn test + + - name: Build artifact + run: mvn package -Dmaven.test.skip + + - name: Build Docker Image + uses: docker/build-push-action@v6 + with: + context: . + push: 'false' + tags: 'hsldevcom/${{ github.repository }}:${{ github.sha }}' + + - name: Setup Docker Buildx + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + uses: docker/setup-buildx-action@v3 + + - name: Extract Docker metadata + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ github.repository }} + tags: | + type=ref,event=branch + type=sha + type=semver,pattern={{version}} + labels: | + org.opencontainers.image.title=${{ github.repository }} + org.opencontainers.image.vendor=hsldevcom + + - name: Login to Github Container Registry + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + uses: docker/login-action@v3 + with: + registry: hsldevcom + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build & Push Docker image + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' + uses: docker/build-push-action@v6 + with: + context: . + push: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + + + + From d78d1aab651b2e1eacc86cdbfd3bfd0419448259 Mon Sep 17 00:00:00 2001 From: bogdandina Date: Thu, 16 Oct 2025 09:27:11 +0300 Subject: [PATCH 2/3] feat(62035): implement ci-cd-java.yml --- .github/workflows/ci-cd-java.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-cd-java.yml b/.github/workflows/ci-cd-java.yml index 208e5e6..472bedd 100644 --- a/.github/workflows/ci-cd-java.yml +++ b/.github/workflows/ci-cd-java.yml @@ -1,13 +1,7 @@ name: ci-cd-java.yml on: - push: - branches: - - main - tags: - - "v*" - pull_request: - merge_group: - + workflow_call: + jobs: build-check-test-push: name: Build, check, test, push From dd9fc919fd7a682fc040fcb7da5875827c01b412 Mon Sep 17 00:00:00 2001 From: bogdandina Date: Thu, 16 Oct 2025 18:02:56 +0300 Subject: [PATCH 3/3] minor refactoring --- .github/workflows/ci-cd-java.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-java.yml b/.github/workflows/ci-cd-java.yml index 472bedd..c25a5c3 100644 --- a/.github/workflows/ci-cd-java.yml +++ b/.github/workflows/ci-cd-java.yml @@ -1,7 +1,7 @@ name: ci-cd-java.yml on: workflow_call: - + jobs: build-check-test-push: name: Build, check, test, push @@ -17,7 +17,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '21' + java-version: '11' cache: 'maven' - name: Check code format and lint