Skip to content

Commit

Permalink
update docker publish job
Browse files Browse the repository at this point in the history
  • Loading branch information
taha.attari@smilecdr.com committed Dec 13, 2024
1 parent bea1ca0 commit 34f01c9
Showing 1 changed file with 44 additions and 38 deletions.
82 changes: 44 additions & 38 deletions .github/workflows/publish-snapshot-vsm-operations.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 34f01c9

Please sign in to comment.