From 36117b5dbe0a72c5c11d48e3f7860e9bf8e765c3 Mon Sep 17 00:00:00 2001 From: abhisheksr01 Date: Wed, 25 Dec 2024 01:10:14 +0000 Subject: [PATCH 1/2] ci(pipeline.yml): #276 add docker-build-push job in GHA workflow --- .github/workflows/pipeline.yml | 44 +++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index b0f5b70..6e5258e 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -111,4 +111,46 @@ jobs: scan-ref: './' exit-code: 1 severity: 'CRITICAL,HIGH' - trivy-config: ./config/trivy/trivy.yaml \ No newline at end of file + trivy-config: ./config/trivy/trivy.yaml + docker-build-push: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + needs: + - unit-test + - mutation-test + - dependency-vulnerability-analysis + - sast-code-snyk + - sast-dockerfile-trivy-hadolint + steps: + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + abhisheksr01/companieshouse + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + labels: | + "org.opencontainers.image.title": "abhisheksr01/companieshouse", + "org.opencontainers.image.description": "Best practices and integrations available for Spring Boot based Microservice in a single repository with companieshouse API use case.", + "org.opencontainers.image.url": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices", + "org.opencontainers.image.source": "https://github.com/abhisheksr01/spring-boot-microservice-best-practices", + "org.opencontainers.image.version": "0.1.0", + "org.opencontainers.image.created": "2020-01-10T00:30:00.000Z", + "org.opencontainers.image.revision": ${{ github.sha }}, + "org.opencontainers.image.licenses": "MIT" + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: abhisheksr01/companieshouse:latest \ No newline at end of file From 9d62f8136c19e5526b8c8cfc94269cdd36531753 Mon Sep 17 00:00:00 2001 From: abhisheksr01 Date: Wed, 25 Dec 2024 14:38:53 +0000 Subject: [PATCH 2/2] ci(pipeline.yml): #275 add cocogitto based conventional-commit-check job in GHA --- .github/workflows/pipeline.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 6e5258e..1d9d2c5 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -5,8 +5,17 @@ on: pull_request: jobs: + conventional-commit-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Conventional commit check + uses: cocogitto/cocogitto-action@v3 + with: + check-latest-tag-only: true # This is required since older commits didn't follow conventional commits build: runs-on: ubuntu-latest + needs: conventional-commit-check steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4