Skip to content

Commit

Permalink
adding build pipeline job
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilmulinti committed Dec 12, 2023
1 parent 4659888 commit 12d17a5
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Java CI Build

on:
push:
branches:
- githubactions-deploy

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'

- name: Cache Maven Packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Maven Build
run: mvn -B package --file pom.xml

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: build/maven/Dockerfile
push: true
tags: user/repo:tag

0 comments on commit 12d17a5

Please sign in to comment.