Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trigger removed and setup duplicate workflow #40

Merged
merged 5 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 38 additions & 13 deletions .github/workflows/gke-cd.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,53 @@
name: Continuous Deploy with GKE

on:
workflow_run:
workflows: [CI with test coverage]
types:
- completed
pull_request:
branches:
- develop
- main

defaults:
run:
working-directory: ./

jobs:
docker:
Test-Coverage-Result:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Corretto openJDK 17
uses: actions/setup-java@v3 # check specific version in https://github.com/actions/setup-java
with:
distribution: 'corretto'
java-version: '17'

- name: Gradle caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Build and test project
run: ./gradlew clean test

- name: Comment jacoco test coverage to pull request
id: jacoco
uses: madrapps/jacoco-report@v1.2
with:
title: 📝 Test code-coverage reports
paths: ${{ github.workspace }}/bm-controller/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 60
min-coverage-changed-files: 60
pass-emoji: ✅
Deploy-to-GKE:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -43,12 +74,6 @@ jobs:
- name: Build and test project
run: ./gradlew build

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
#
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3

- name: Build docker image and push
run: bash ./script/img_push_multi_arch.sh -u ${{ secrets.DOCKERHUB_USERNAME }} -t ${{ secrets.DOCKERHUB_TOKEN }}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/gradle-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
branches:
- "develop**"
- "main"

jobs:
Test-Coverage-Result:
Expand Down
Loading