From cc228c554dbf1d6cda7879d3cee207c1e4525418 Mon Sep 17 00:00:00 2001 From: kdaud Date: Wed, 25 Sep 2024 08:01:38 +0300 Subject: [PATCH] INFRA-411: Added GitHub shared workflow to build and publish artifacts. --- .github/workflows/build-publish.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/build-publish.yml diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..9722c27 --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,28 @@ +name: Build and Publish + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + types: [published] + +jobs: + build: + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-build-test.yml@main + with: + java-version: "8" + maven-phase: "install" + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} + + publish: + if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'release' }} + needs: build + uses: mekomsolutions/shared-github-workflow/.github/workflows/maven-publish.yml@main + secrets: + NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} +