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: Java CI with Gradle | |
on: | |
push: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Build with Gradle | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
with: | |
arguments: build | |
- name: Test Coverage Verification | |
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 | |
with: | |
arguments: jacocoTestCoverageVerification | |
- name: Docker Login | |
env: | |
DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag ${{secrets.DOCKER_USER}}/template-service-java-springboot:latest | |
- name: Build the Fluentbit Docker image | |
run: docker build . --file Fluentbit-Dockerfile --tag ${{secrets.DOCKER_USER}}/template-service-java-springboot-fluentbit:latest | |
- name: Docker Push To DockerHub | |
run: docker push ${{secrets.DOCKER_USER}}/template-service-java-springboot | |
- name: Docker Push Fluentbit To DockerHub | |
run: docker push ${{secrets.DOCKER_USER}}/template-service-java-springboot-fluentbit |