Skip to content

Workflow file for this run

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: Check Format with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: checkformat
- name: Setup
run: make local-setup
- name: Build with Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build
# - name: Checkmarx Action
# uses: checkmarx-ts/checkmarx-github-action@<version>
# with:
# cxServer: https://checkmarx.company.com
# cxToken: ${{ secrets.CX_TOKEN }}
# cxTeam: \CxServer\SP\Company\TeamA
# cxGithubIssues: true
# cxGithubToken: ${{ secrets.GITHUB_TOKEN }}
# cxGithubLabels: bug,test
# cxGithubAssignees: shubham108
- name: Test Coverage Verification
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: jacocoTestCoverageVerification
- name: Teardown
run: make teardown
- 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: Prisma Cloud image scan
# id: scan
# uses: PaloAltoNetworks/[email protected]
# with:
# pcc_console_url: ${{ secrets.PCC_CONSOLE_URL }}
# pcc_user: ${{ secrets.PCC_USER }}
# pcc_pass: ${{ secrets.PCC_PASS }}
# image_name: template-service-java-springboot-fluentbit:latest
# - name: Prisma Cloud image scan - Fluentbit
# id: scan
# uses: PaloAltoNetworks/[email protected]
# with:
# pcc_console_url: ${{ secrets.PCC_CONSOLE_URL }}
# pcc_user: ${{ secrets.PCC_USER }}
# pcc_pass: ${{ secrets.PCC_PASS }}
# image_name: template-service-java-springboot:latest
- name: Docker Push To DockerHub
run: docker push ${{secrets.DOCKER_USER}}/template-service-java-springboot