Skip to content

[Rahul] | BAH-4097 | Add. Tag Based Push Trigger (#19) #10

[Rahul] | BAH-4097 | Add. Tag Based Push Trigger (#19)

[Rahul] | BAH-4097 | Add. Tag Based Push Trigger (#19) #10

name: Pacs Simulator-Build and Publish
on:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
paths:
- 'Pacs_Simulator/**'
- '.github/workflows/pacs_simulator_build_publish.yml'
defaults:
run:
working-directory: Pacs_Simulator
jobs:
docker-build-publish:
name: Docker Build & Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Verify app version
run: |
APP_VERSION=$(cat package/.appversion)
if [ $(git tag -l "$APP_VERSION") ]; then
echo "App version $APP_VERSION already released. Please update app version in package/.appversion to represent next major/minor/patch increment"
exit 1
else
echo "setting artifact version to $(echo $APP_VERSION-${{github.run_number}})"
echo "ARTIFACT_VERSION=$(echo $APP_VERSION-${{github.run_number}})" >> $GITHUB_ENV
fi
- name: Setup Java 8
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: "8"
- name: Setup Local Dependencies
run: |
mkdir local-maven-repo
./mvnw deploy:deploy-file -DgroupId=pixelmed -DartifactId=pixelmed -Dversion=20150809 -Durl=file:./local-maven-repo/ -DrepositoryId=local-maven-repo -DupdateReleaseInfo=true -Dfile=./lib/pixelmed-20150809.jar
- name: Run Unit Tests and Package
run: ./mvnw --no-transfer-progress clean install -U assembly:single
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker Build and push
uses: docker/build-push-action@v2
with:
context: Pacs_Simulator/
file: Pacs_Simulator/package/docker/Dockerfile
push: true
tags: bahmni/pacs-simulator:${{env.ARTIFACT_VERSION}},bahmni/pacs-simulator:latest