From 9981dec11798eabcb665d6489b0d298566130295 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Sun, 18 Aug 2024 05:05:59 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[cicd]=20discord=20=EC=97=90=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC=EC=9D=B4=20=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/discord-pr.yaml | 19 ++++++++++++++++++ .github/workflows/main.yml | 32 ++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/discord-pr.yaml diff --git a/.github/workflows/discord-pr.yaml b/.github/workflows/discord-pr.yaml new file mode 100644 index 0000000..8e04ea0 --- /dev/null +++ b/.github/workflows/discord-pr.yaml @@ -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 }}' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 582e3dd..51376ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 From 39bedc882206f8748fdf2303adbea5607cf0d346 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Sun, 18 Aug 2024 05:31:07 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[feat/cicd]=20discord=20=EC=B1=84=EB=84=90?= =?UTF-8?q?=EC=97=90=20=ED=95=B4=EB=8B=B9=20=EB=A9=94=EC=8B=9C=EC=A7=80?= =?UTF-8?q?=EA=B0=80=20=EC=A0=81=EC=A0=88=ED=95=98=EA=B2=8C=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/discord-pr.yaml | 8 +++++++- .github/workflows/main.yml | 26 ++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/discord-pr.yaml b/.github/workflows/discord-pr.yaml index 8e04ea0..a7b8377 100644 --- a/.github/workflows/discord-pr.yaml +++ b/.github/workflows/discord-pr.yaml @@ -14,6 +14,12 @@ jobs: - name: Discord Notification env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_PR_WEBHOOK }} + DISCORD_USERNAME: GitHub + DISCORD_AVATAR: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png 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 }}' + args: | + 새로운 PR이 열렸습니다! <@lkhoony> <@baezzy1789> + PR: ${{ github.event.pull_request.html_url }} + 작성자: ${{ github.event.pull_request.user.login }} + 제목: ${{ github.event.pull_request.title }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51376ad..2974e9b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,6 +9,15 @@ jobs: steps: - name: Checkout source code uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get commit message and author + id: get_commit_info + run: | + echo "::set-output name=message::$(git log --format=%s -n 1)" + echo "::set-output name=author::$(git log --format=%an -n 1)" + echo "::set-output name=author_username::$(git log --format=%ae -n 1 | cut -d@ -f1)" - name: Install dependencies run: yarn install @@ -29,17 +38,30 @@ jobs: if: steps.deploy.outcome == 'success' env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }} + DISCORD_USERNAME: GitHub + DISCORD_AVATAR: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png uses: Ilshidur/action-discord@master with: - args: "🎉 배포가 성공적으로 완료되었습니다! 브랜치: develop" + args: | + 🎉 배포가 성공적으로 완료되었습니다! + 브랜치: develop + 커밋: ${{ steps.get_commit_info.outputs.message }} + 작성자: ${{ steps.get_commit_info.outputs.author }} - name: Discord notification - Failure if: steps.deploy.outcome == 'failure' env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_DEPLOY_WEBHOOK }} + DISCORD_USERNAME: GitHub + DISCORD_AVATAR: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png uses: Ilshidur/action-discord@master with: - args: "❌ 배포 중 오류가 발생했습니다. 브랜치: develop" + args: | + ❌ 배포 중 오류가 발생했습니다. + 브랜치: develop + 커밋: ${{ steps.get_commit_info.outputs.message }} + 작성자: <@${{ steps.get_commit_info.outputs.author_username }}> + 실패한 워크플로우: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - name: Check deploy result if: steps.deploy.outcome == 'failure' From 8f209dcac05ea3913d044954b9d6f0cb65e8bd37 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Sun, 18 Aug 2024 05:34:37 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[feat/cicd]=20discord=20=EC=B1=84=EB=84=90?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EA=B4=80=EB=A0=A8=EC=9E=90=EB=93=A4?= =?UTF-8?q?=EC=9D=B4=20=ED=83=9C=EA=B7=B8=20=EB=90=98=EB=8A=94=EC=A7=80=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/discord-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord-pr.yaml b/.github/workflows/discord-pr.yaml index a7b8377..1dcd94e 100644 --- a/.github/workflows/discord-pr.yaml +++ b/.github/workflows/discord-pr.yaml @@ -19,7 +19,7 @@ jobs: uses: Ilshidur/action-discord@master with: args: | - 새로운 PR이 열렸습니다! <@lkhoony> <@baezzy1789> + 새로운 PR이 열렸습니다! @lkhoony @baezzy1789 @이광훈 @배지훈 PR: ${{ github.event.pull_request.html_url }} 작성자: ${{ github.event.pull_request.user.login }} 제목: ${{ github.event.pull_request.title }} From cb00b9f30603750b96885ba53152f1d02b46f1e0 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Sun, 18 Aug 2024 05:46:50 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[feat/cicd]=20PR=EC=9D=B4=20=EC=97=B4?= =?UTF-8?q?=EB=A0=B8=EC=9D=84=20=EB=95=8C,=20discord=20=EC=B1=84=EB=84=90?= =?UTF-8?q?=EC=97=90=20user=20id=20=EA=B0=80=20=ED=83=9C=EA=B7=B8=20?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/discord-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/discord-pr.yaml b/.github/workflows/discord-pr.yaml index 1dcd94e..4b40806 100644 --- a/.github/workflows/discord-pr.yaml +++ b/.github/workflows/discord-pr.yaml @@ -19,7 +19,7 @@ jobs: uses: Ilshidur/action-discord@master with: args: | - 새로운 PR이 열렸습니다! @lkhoony @baezzy1789 @이광훈 @배지훈 + 새로운 PR이 열렸습니다!<@${{ secrets.DISCORD_ID_1 }}> <@${{ secrets.DISCORD_ID_2 }}> PR: ${{ github.event.pull_request.html_url }} 작성자: ${{ github.event.pull_request.user.login }} 제목: ${{ github.event.pull_request.title }} From be27b4bcd29f4619e60e3215e1453a761027c201 Mon Sep 17 00:00:00 2001 From: G-hoon Date: Mon, 19 Aug 2024 22:43:19 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[feat/#19]=20=EB=B9=8C=EB=93=9C=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SideNav.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SideNav.tsx b/src/components/SideNav.tsx index 486d125..7e0bc50 100644 --- a/src/components/SideNav.tsx +++ b/src/components/SideNav.tsx @@ -48,7 +48,7 @@ export default function SideNav() { {/* Navigation Links */}