From abaf119befc21fab31a28e856477672f2b37606c Mon Sep 17 00:00:00 2001 From: Kipchumba Bett Date: Fri, 2 Feb 2024 19:29:46 +0300 Subject: [PATCH] OZ-438: Use shared GitHub Actions workflow. (#77) --- .github/workflows/build-publish.yml | 14 ------------ .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 14 deletions(-) delete mode 100644 .github/workflows/build-publish.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml deleted file mode 100644 index 5816e37..0000000 --- a/.github/workflows/build-publish.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Build and Publish - -on: - push: -jobs: - build-and-publish: - uses: mekomsolutions/mekom-github-workflow-maven/.github/workflows/build-publish-workflow.yml@main - with: - webhook-url: https://openmrs-cd.mekomsolutions.net/generic-webhook-trigger/invoke - secrets: - NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} - NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} - OCD3_USERNAME: ${{ secrets.OCD3_USERNAME }} - OCD3_PASSWORD: ${{ secrets.OCD3_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c5fe435 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + release: + types: [published] + +jobs: + validate: + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main + with: + java-version: "8" + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + pre-release: + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: validate + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + release: + if: ${{ github.event_name == 'release' }} + needs: validate + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}