Skip to content

Commit

Permalink
Spring Boot CI Pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaynegi45 committed Sep 1, 2024
1 parent 3e3bd40 commit 3b132b3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 57 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/java-ci.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
#
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

#name: Maven Package
#

#on:
# release:
# types: [created]
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/spring-boot-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Spring Boot CI Pipeline

on:
push:
branches:
- 'main'
pull_request:
branches:
- '**' # Run on all PRs to any branch

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Install dependencies
run: mvn clean install

- name: Run Spring Boot Application
run: mvn spring-boot:run
env:
ENV: production
DATABASE_URL: ${{ secrets.DATABASE_URL }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_DRIVER_CLASS_NAME: ${{ secrets.DATABASE_DRIVER_CLASS_NAME }}

- name: Run Tests
run: mvn test

0 comments on commit 3b132b3

Please sign in to comment.