Skip to content

Commit

Permalink
[#1236] Github Actions CI/CD 잔디 알람 적용 (#1237)
Browse files Browse the repository at this point in the history
Co-authored-by: byeongwan <byeongwan@ex-em.com>
  • Loading branch information
b-wani and byeongwan authored Jul 13, 2022
1 parent 4478fe0 commit fcceb96
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/actions/jandi-notify/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'jandi-notify'

inputs:
status:
required: false
description: CI/CD status
default: 'failure'
jandi_incoming_url:
description: jandi webhook URL
required: true

description: jandi notify action
runs:
using: 'composite'
steps:
- name: Send jandi
shell: bash
run: |
COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
if [ "${{ inputs.status }}" = "success" ]; then
curl \
-X POST "${{ inputs.jandi_incoming_url }}" \
-H "Accept: application/vnd.tosslab.jandi-v2+json" \
-H "Content-Type: application/json" \
--data-binary '{"body":"📢 EVUI CI/CD Notification - ✅ Deployment succeeded", "connectColor":"#4285F6", "connectInfo":[{"title":"Commit message","description":"- '"${COMMIT_MESSAGE}"'"},{"title":"EVUI document","description":"- [[EVUI]](https://ex-em.github.io/EVUI)"}]}'
else
curl \
-X POST "${{ inputs.jandi_incoming_url }}" \
-H "Accept: application/vnd.tosslab.jandi-v2+json" \
-H "Content-Type: application/json" \
--data-binary '{"body":"📢 EVUI CI/CD Notification - ⛔ Deployment failed", "connectColor":"#FF4C15", "connectInfo":[{"title":"Commit message","description":"- '"${COMMIT_MESSAGE}"'"},{"title":"Error log","description":"- [[Workflow]](https://github.com/'"${GITHUB_REPOSITORY}"'/actions/runs/'"${GITHUB_RUN_ID}"')"}]}'
fi
24 changes: 22 additions & 2 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ jobs:
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: 'npm'

- name: Cache node module
uses: actions/cache@v2
id: cache
with:
path: node_modules
key: npm-packages-${{ hashFiles('**/package-lock.json') }}

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install

- name: Build Docs
Expand All @@ -29,3 +36,16 @@ jobs:
with:
github_token: ${{ secrets.GH_ACTIONS_TOKEN }}
publish_dir: ./dist

- name: Send jandi when failed
if: ${{ failure() }}
uses: ./.github/actions/jandi-notify
with:
jandi_incoming_url: ${{ secrets.JANDI_INCOMING_URL }}

- name: Send jandi if completed
if: ${{ success() }}
uses: ./.github/actions/jandi-notify
with:
status: success
jandi_incoming_url: ${{ secrets.JANDI_INCOMING_URL }}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "evui",
"version": "3.3.33",
"version": "3.3.34",
"description": "A EXEM Library project",
"author": "exem <dev_client@ex-em.com>",
"license": "MIT",
Expand Down

0 comments on commit fcceb96

Please sign in to comment.