Skip to content

Commit

Permalink
[cicd] discord 에 알림이 오도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
G-hoon committed Aug 17, 2024
1 parent 5d4e0cb commit 9981dec
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/discord-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Discord PR Notification

on:
pull_request:
types: [opened, reopened]

jobs:
notify_discord:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Discord Notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_PR_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: '새로운 PR이 열렸습니다! @이광훈 @배지훈 \nPR: ${{ github.event.pull_request.html_url }}\n작성자: ${{ github.event.pull_request.user.login }}\n제목: ${{ github.event.pull_request.title }}'
32 changes: 27 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,40 @@ jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout source code.
- name: Checkout source code
uses: actions/checkout@v3

- name: Install dependencies
run: yarn install

- name: Generate build
run: yarn build

- name: Deploy

- name: Deploy to S3
id: deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync --region ap-northeast-2 dist s3://alignlab-client --delete
continue-on-error: true

- name: Discord notification - Success
if: steps.deploy.outcome == 'success'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "🎉 배포가 성공적으로 완료되었습니다! 브랜치: develop"

- name: Discord notification - Failure
if: steps.deploy.outcome == 'failure'
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "❌ 배포 중 오류가 발생했습니다. 브랜치: develop"

- name: Check deploy result
if: steps.deploy.outcome == 'failure'
run: exit 1

0 comments on commit 9981dec

Please sign in to comment.