Skip to content

Commit

Permalink
feat: 알림 서버 prod 환경 CI 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
GaBaljaintheroom committed Sep 6, 2024
1 parent 1189c74 commit 44f7004
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/showpotAlarm-prod-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: ShowPotAlarm-Prod-CI

on:
pull_request:
branches:
- prod
push:
branches:
- feat/prod-setting

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'liberica'
cache: gradle

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Copy Secrets
uses: microsoft/variable-substitution@v1
with:
files: |
./app/src/main/resources/application-dev.yml,
./app/domain/common-domain/src/main/resources/application-domain-dev.yml,
./app/infrastructure/fcm/src/main/resources/application-fcm-dev.yml
env:
spring.datasource.url: ${{ secrets.APPLICATION_DATASOURCE_URL_DEV }}
spring.datasource.username: ${{ secrets.APPLICATION_DATASOURCE_USERNAME }}
spring.datasource.password: ${{ secrets.APPLICATION_DATASOURCE_PASSWORD }}
fcm.project_id: ${{ secrets.FCM_PROJECT_ID }}
fcm.private_key_id: ${{ secrets.FCM_PRIVATE_KEY_ID }}
fcm.private_key: ${{ secrets.FCM_PRIVATE_KEY }}
fcm.client_email: ${{ secrets.FCM_CLIENT_EMAIL }}
fcm.client_id: ${{ secrets.FCM_CLIENT_ID }}

- name: Build with Gradle Wrapper
run: ./gradlew clean build -Dspring.profiles.active=prod

- name: Backend CI Discord Notification
uses: sarisia/actions-status-discord@v1
if: success()
with:
title: ✅ ShowPot Alarm Backend Prod CI success ✅
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
content: "<@1084774841460215839> <@281597829636423682> ShoPot-Alarm Server 이슈 혹은 PR을 확인해주세요!"
color: 00FF00
username: showPot-Bot
avatar_url: ${{ secrets.DISCORD_NOTIFICATION_SUCCESS_AVATAR_URL }}

- name: Backend CI Discord Notification
uses: sarisia/actions-status-discord@v1
if: failure()
with:
title: ❗️ShowPot Alarm Backend CI failed ❗️
webhook: ${{ secrets.DISCORD_WEBHOOK_URL }}
color: FF0000
username: showPot-Bot
avatar_url: ${{ secrets.DISCORD_NOTIFICATION_FAILED_AVATAR_URL }}

0 comments on commit 44f7004

Please sign in to comment.