Skip to content

[Feat] 어드민 UI 구현 #12

[Feat] 어드민 UI 구현

[Feat] 어드민 UI 구현 #12

name: Build and Comment
on:
pull_request:
branches:
- main
- dev
paths:
- "admin/**"
jobs:
build-admin:
runs-on: ubuntu-latest
env:
working-directory: ./admin
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
- name: Install dependencies
run: yarn
working-directory: ${{ env.working-directory }}
- name: Build project
run: yarn build
working-directory: ${{ env.working-directory }}
comment-admin:
needs: build-admin
runs-on: ubuntu-latest
if: always()
steps:
# 성공 시 코멘트
- name: Add a comment on success
if: ${{ needs.build.result == 'success' }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '빌드를 성공했습니다! :tada:'
})
# 실패 시 코멘트
- name: Add a comment on failure
if: ${{ needs.build.result == 'failure' }}
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '빌드를 실패했습니다. :x: 자세한 내용은 로그를 참고해주세요.'
})