Skip to content

Update main.yml

Update main.yml #27

Workflow file for this run

name: workflow of java springboot
on:
push:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set Up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven Dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get Maven Build Version
id: get-version
run: |
echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | tail -1)" >> $GITHUB_OUTPUT
- name: Build with Maven
run: mvn clean package -DskipTests
- name: Login to JFrog Artifactory
uses: docker/login-action@v2
with:
registry: trialktyenb.jfrog.io
username: ${{ secrets.JFROG_USERNAME }}
password: ${{ secrets.JFROG_TOKEN }}
- name: Docker metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: "${{ inputs.docker-repository }}/${{ steps.prep.outputs.image }}"
labels: |
com.uhg.image.askid=${{ inputs.ask-id }}
com.uhg.image.branch=${{ github.ref }}
com.uhg.image.build=${{ github.run_id }}
com.uhg.image.buildnumber=${{ github.run_number }}
com.uhg.image.buildurl=${{ github.run_url }}
com.uhg.image.repo_id=${{ github.repository_id }}
com.uhg.image.workflow_name=${{ github.workflow }}
com.uhg.image.workflow_ref=${{ github.workflow_ref }}
org.opencontainers.image.source=${{ github.repository }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
org.opencontainers.image.authors=${{ github.event.head_commit.author.name }}
org.opencontainers.image.url=${{ github.event.head_commit.url }}
org.opencontainers.image.documentation=${{ github.event.head_commit.url }}
org.opencontainers.image.vendor=UnitedHealth Group
org.opencontainers.image.description=${{ steps.get-description.outputs.repo-description }}
tags: ${{ steps.prep.outputs.tag }}