mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
Update maven-build.yml
This commit is contained in:
parent
1d1efb463c
commit
3f80cdb0b2
1 changed files with 18 additions and 8 deletions
26
.github/workflows/maven-build.yml
vendored
26
.github/workflows/maven-build.yml
vendored
|
@ -6,7 +6,7 @@ on:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: "test-maven-app"
|
IMAGE_NAME: "test-maven-app"
|
||||||
DOCKERHUB_USERNAME: "kunchalavikram"
|
DOCKERHUB_USERNAME: "kunchalavikram"
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -18,17 +18,27 @@ jobs:
|
||||||
- name: Setup Java and Maven
|
- name: Setup Java and Maven
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
distribution: 'temurin'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
- name: Check java and mvn version
|
|
||||||
run: |
|
|
||||||
java -version
|
|
||||||
mvn --version
|
|
||||||
- name: Run Tests
|
|
||||||
run: mvn test
|
|
||||||
- name: Package the Application
|
- name: Package the Application
|
||||||
run: |
|
run: |
|
||||||
mvn -B package
|
mvn -B package
|
||||||
ls -al ${{ github.workspace }}/target
|
ls -al ${{ github.workspace }}/target
|
||||||
|
- name: Upload Artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: war-file
|
||||||
|
path: target/*.war
|
||||||
|
if-no-files-found: 'error'
|
||||||
|
retention-days: 1 day
|
||||||
|
|
||||||
|
dockerize:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download Artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: war-file
|
||||||
|
path: target/*.war
|
||||||
- name: Dockerize the Application
|
- name: Dockerize the Application
|
||||||
run: docker build -t ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME}}:${{ github.run_number }} .
|
run: docker build -t ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME}}:${{ github.run_number }} .
|
||||||
|
|
Loading…
Reference in a new issue