|
|
@@ -11,17 +11,20 @@ jobs:
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
steps:
|
|
|
- - uses: actions/checkout@v3
|
|
|
- - name: Build jar
|
|
|
- run: chmod +x ./mvnw && ./mvnw clean jar:jar
|
|
|
- - name: Run tests
|
|
|
- run: ./mvnw test
|
|
|
- - name: Build the Docker image
|
|
|
- run: ./mvnw spring-boot:build-image
|
|
|
- - name: Login to Docker Hub
|
|
|
- uses: docker/login-action@v2
|
|
|
- with:
|
|
|
- username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
- password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
- - name: Push image
|
|
|
- run: docker push lhamacorp/stocks-be
|
|
|
+ - uses: actions/checkout@v3
|
|
|
+ - name: Set up JDK
|
|
|
+ uses: actions/setup-java@v3
|
|
|
+ with:
|
|
|
+ java-version: '17' # or the version you use
|
|
|
+ distribution: 'temurin' # or another distribution
|
|
|
+ - name: Build with Maven
|
|
|
+ run: chmod +x ./mvnw && ./mvnw clean package test
|
|
|
+ - name: Build the Docker image
|
|
|
+ run: ./mvnw spring-boot:build-image
|
|
|
+ - name: Login to Docker Hub
|
|
|
+ uses: docker/login-action@v2
|
|
|
+ with:
|
|
|
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
+ - name: Push image
|
|
|
+ run: docker push lhamacorp/stocks-be
|