Skip to content

chore: Update ci-jacoco.yml DOCKER to DOCKERHUB #6

chore: Update ci-jacoco.yml DOCKER to DOCKERHUB

chore: Update ci-jacoco.yml DOCKER to DOCKERHUB #6

Workflow file for this run

name: 'ContinuousIntegration'
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development
jobs:
ContinuousIntegration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
- name: Jacoco Report to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
with:
paths: ${{ github.workspace }}/build/jacocoReport/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
debug-mode: false
title: Code Coverage
update-comment: true
- name: Upload jacoco HTML report
uses: actions/upload-artifact@v4
with:
name: jacoco-html-report
path: ${{ github.workspace }}/build/jacocoReport/test/html
- name: Get the Coverage info
run: |
echo "Total coverage ${{ steps.jacoco.outputs.coverage-overall }}"
echo "Changed Files coverage ${{ steps.jacoco.outputs.coverage-changed-files }}"
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build Docker Image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/readup-server:${{ github.sha }} .
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/readup-sever:${{ github.sha }} ${{ secrets.DOCKERHUB_USERNAME }}/springboot-app:latest
- name: Push Docker Image
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/readup-sever:${{ github.sha }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/readup-sever:latest