From bdbf832812f82863ac29e6bfafd12ed308444750 Mon Sep 17 00:00:00 2001 From: "Kipchumba C. Bett" Date: Tue, 2 Jul 2024 10:54:58 +0300 Subject: [PATCH] KH-520: Introduce validate-prod only on push to main --- .github/workflows/ci.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f4a9b95..662fb3c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,15 +7,24 @@ on: branches: [main] jobs: + validate-pr: + if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }} + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main + with: + java-version: "8" + maven-phase: "install" + secrets: + NEXUS_USERNAME: ${{ secrets.MEKOM_NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.MEKOM_NEXUS_PASSWORD }} + validate: + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main with: java-version: "8" maven-phase: "install" - maven-args: - ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' ? '-P prod -DskipTests': '' }} - use-secrets: - ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' ? true: false }} + maven-args: "-P prod -DskipTests" + use-secrets: true secrets: NEXUS_USERNAME: ${{ secrets.MEKOM_NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.MEKOM_NEXUS_PASSWORD }}