Added utility script and pipeline to build/push Docker image #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: temurin | |
- name: Compile with maven | |
run: mvn validate test-compile | |
- name: Test with maven | |
run: mvn surefire:test | |
- name: Package to jar | |
run: mvn jar:jar | |
- run: mkdir staging && cp target/*.jar staging | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Package | |
path: staging |