From d031b2c4860901dfc57fd6a47010ee148fc4e8d5 Mon Sep 17 00:00:00 2001 From: "taha.attari@smilecdr.com" Date: Tue, 1 Aug 2023 14:47:45 -0400 Subject: [PATCH] [APHL-630] different jobs for master and vsm ops --- .../publish-snapshot-vsm-operations.yml | 38 +++++++++++++++++++ .github/workflows/publish-snapshot.yml | 12 +++++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish-snapshot-vsm-operations.yml diff --git a/.github/workflows/publish-snapshot-vsm-operations.yml b/.github/workflows/publish-snapshot-vsm-operations.yml new file mode 100644 index 000000000..151ae2e5c --- /dev/null +++ b/.github/workflows/publish-snapshot-vsm-operations.yml @@ -0,0 +1,38 @@ +name: Publish Snapshot +on: + push: + branches: + - vsm_operations +jobs: + maven: + runs-on: ubuntu-latest + steps: + - name: Add SHORT_SHA env property with commit short sha + run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ vars.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: alphora/cqf-ruler:cqf-ruler-vsm + build-args: COMMIT_HASH=${{ env.SHORT_SHA }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 151ae2e5c..971e451c3 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -2,7 +2,8 @@ name: Publish Snapshot on: push: branches: - - vsm_operations + - master + jobs: maven: runs-on: ubuntu-latest @@ -19,6 +20,11 @@ jobs: server-id: ossrh server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD + - name: Publish snapshot + run: mvn --batch-mode -no-transfer-progress --update-snapshots deploy + env: + MAVEN_USERNAME: ${{ vars.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Login to Docker Hub @@ -32,7 +38,9 @@ jobs: context: . push: true platforms: linux/amd64,linux/arm64 - tags: alphora/cqf-ruler:cqf-ruler-vsm + tags: | + contentgroup/cqf-ruler:latest + alphora/cqf-ruler:latest build-args: COMMIT_HASH=${{ env.SHORT_SHA }} cache-from: type=gha cache-to: type=gha,mode=max