Skip to content
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
43 changes: 43 additions & 0 deletions .github/actions/slack-notify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: 'Slack Notification'
description: 'Send notification to Slack'
inputs:
status:
required: true
webhook-url:
required: true
runs:
using: "composite"
steps:
- shell: bash
run: |
if [ "${{ inputs.status }}" = "success" ]; then
message="*Success:* βœ… Backend CI Success βœ…"
title="Success"
image_url="https://thumbs.dreamstime.com/b/success-red-stamp-text-white-44312500.jpg"
else
message="*Failure:* ❗️ Backend CI Failed ❗️"
title="Failure"
image_url="https://w7.pngwing.com/pngs/68/227/png-transparent-rubber-stamp-blue-world-dive-more-gmbh-architectural-engineering-office-praxis-fur-energetische-heilkunste-und-kinesiologie-others-text-rectangle-signage-thumbnail.png"
fi

curl -X POST -H 'Content-type: application/json' \
--data "{
\"blocks\": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"$message\n*Repository:* ${{ github.repository }}\n*Ref:* ${{ github.ref }}\n*Event:* ${{ github.event_name }}\n*Commit:* ${{ github.sha }}\n*Triggered by:* ${{ github.actor }}\n*Workflow:* ${{ github.workflow }}\"
}
},
{
\"type\": \"image\",
\"title\": {
\"type\": \"plain_text\",
\"text\": \"$title\"
},
\"image_url\": \"$image_url\",
\"alt_text\": \"$title\"
}
]
}" ${{ inputs.webhook-url }}
74 changes: 13 additions & 61 deletions .github/workflows/gradle.yml β†’ .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# .github/workflows/ci.yml
name: Java CI with Gradle

on:
Expand Down Expand Up @@ -26,6 +27,7 @@ jobs:
with:
cache-read-only: ${{ github.ref != 'refs/heads/develop' }}


- name: Build with Gradle Wrapper
run: ./gradlew build
env:
Expand All @@ -35,25 +37,26 @@ jobs:
SPRING_DATASOURCE_USERNAME: sa
SPRING_DATASOURCE_PASSWORD: password

SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL: true
SPRING_JPA_PROPERTIES_HIBERNATE_SHOW_SQL: true
SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL: false
SPRING_JPA_PROPERTIES_HIBERNATE_SHOW_SQL: false
SPRING_JPA_OPEN_IN_VIEW: false

# OAuth2 Client Information (use GitHub Secrets)
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT_SECRET: ${{ secrets.KAKAO_CLIENT_SECRET }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_REDIRECT_URI: http://localhost:8080/login/oauth2/code/kakao
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_REDIRECT_URI: ${{ secrets.KAKAO_REDIRECT_URI }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_AUTHORIZATION_GRANT_TYPE: authorization_code
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_SCOPE: profile_nickname, profile_image
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_KAKAO_CLIENT_NAME: Kakao

SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KAKAO_AUTHORIZATION_URI: https://kauth.kakao.com/oauth/authorize
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KAKAO_TOKEN_URI: https://kauth.kakao.com/oauth/token
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KAKAO_USER_INFO_URI: https://kapi.kakao.com/v2/user/me
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_KAKAO_USER_NAME_ATTRIBUTE: id

SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_REDIRECT_URI: http://localhost:8080/login/oauth2/code/google
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI }}
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_AUTHORIZATION_GRANT_TYPE: authorization_code
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_SCOPE: https://www.googleapis.com/auth/userinfo.profile, https://www.googleapis.com/auth/userinfo.email
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_GOOGLE_CLIENT_NAME: Google
Expand All @@ -68,62 +71,11 @@ jobs:
LOGGING_LEVEL_ROOT: info
LOGGING_LEVEL_COM_MYCOM: debug

- name: Backend CI Slack Notification (Success)
if: success()
uses: 8398a7/action-slack@v3
- name: Notify CI Slack
if: always()
uses: ./.github/actions/slack-notify
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Success:* βœ… Backend CI Success βœ…\n\n*Repository:* ${{ github.repository }}\n*Ref:* ${{ github.ref }}\n\n*Event:* ${{ github.event_name }}\n*Commit:* ${{ github.sha }}\n*Triggered by:* ${{ github.actor }}\n*Workflow:* ${{ github.workflow }}"
}
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Success"
},
"image_url": "https://thumbs.dreamstime.com/b/success-red-stamp-text-white-44312500.jpg",
"alt_text": "Success"
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}


- name: Backend CI Slack Notification (Failure)
if: failure()
uses: 8398a7/action-slack@v3
with:
status: custom
fields: workflow,job,commit,repo,ref,author,took
custom_payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Failure:* ❗️ Backend CI Failed ❗️\n\n*Repository:* ${{ github.repository }}\n*Ref:* ${{ github.ref }}\n\n*Event:* ${{ github.event_name }}\n*Commit:* ${{ github.sha }}\n*Triggered by:* ${{ github.actor }}\n*Workflow:* ${{ github.workflow }}"
}
},
{
"type": "image",
"title": {
"type": "plain_text",
"text": "Failure"
},
"image_url": "https://w7.pngwing.com/pngs/68/227/png-transparent-rubber-stamp-blue-world-dive-more-gmbh-architectural-engineering-office-praxis-fur-energetische-heilkunste-und-kinesiologie-others-text-rectangle-signage-thumbnail.png",
"alt_text": "Failure"
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading