Create a container Dockerfile and PR pipeline

This commit is contained in:
Alex Snihovyi 2024-07-30 11:47:06 -05:00
parent 383edc1656
commit 103a8ecb57
2 changed files with 32 additions and 0 deletions

25
.github/workflows/pr-workflow.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: PR Build
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "corretto"
- uses: gradle/actions/setup-gradle@v3
with:
add-job-summary-as-pr-comment: on-failure
- name: Run Build & tests
env:
GRADLE_CREDS: ${{ secrets.GRADLE_CREDS }}
run: |
echo ${GRADLE_CREDS} | base64 --decode > ~/.gradle/gradle.properties
./gradlew build

7
Dockerfile Normal file
View file

@ -0,0 +1,7 @@
FROM amazoncorretto:17-alpine
WORKDIR /app
COPY build/libs/spring-petclinic-3.3.0.jar .
CMD [ "java", "-jar", "spring-petclinic-3.3.0.jar" ]