From 34f01c9bdfb365d29ac38d317d2879534b6003c5 Mon Sep 17 00:00:00 2001 From: "taha.attari@smilecdr.com" Date: Fri, 13 Dec 2024 14:53:54 -0500 Subject: [PATCH] update docker publish job --- .../publish-snapshot-vsm-operations.yml | 82 ++++++++++--------- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/.github/workflows/publish-snapshot-vsm-operations.yml b/.github/workflows/publish-snapshot-vsm-operations.yml index 546bc9778..c5f70d89f 100644 --- a/.github/workflows/publish-snapshot-vsm-operations.yml +++ b/.github/workflows/publish-snapshot-vsm-operations.yml @@ -1,40 +1,46 @@ -name: Publish Snapshot VSM Operations +name: Publish Snapshot on: - push: - branches: - - hapi-7-5-4 + push: + branches: + - hapi-7-5-4 + 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: Install - run: ./scripts/install.sh - - 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 + 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@v4 + with: + submodules: true + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 21 + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Package jars + run: ./mvnw -T 4 --batch-mode -no-transfer-progress --update-snapshots package + 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 + 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: | + 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