๐[Design] ๋ชจ์ ์นด๋, ๋ฒํผ ํธ๋ฒ ํจ๊ณผ ์ ์ฉ (#324) #367
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - '**' | |
| - '!main' | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| ci: | |
| name: Lint, Test, and Build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run ESLint | |
| run: npm run lint | |
| - name: Run Tests | |
| run: npm test | |
| - name: Build Next.js app | |
| run: npm run build | |
| - name: Build Storybook | |
| run: npm run build-storybook | |
| notify-discord: | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| if: success() | |
| steps: | |
| - name: Send Discord Notification | |
| env: | |
| WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | |
| DATA: > | |
| { | |
| "embeds": [ | |
| { | |
| "title": "${{ | |
| format('{0}', | |
| (github.base_ref == 'develop' || github.ref_name == 'develop') | |
| && '๐ Develop ๋ธ๋์น CI ์๋ฆผ' | |
| || '๐ ์ ์์ CI ์๋ฆผ' | |
| ) | |
| }}", | |
| "description": "${{ | |
| format('{0}', | |
| github.event_name == 'pull_request' | |
| && (github.base_ref == 'develop' | |
| && format('Develop ๋ธ๋์น๋ก ์๋ก์ด PR์ด ๋ฑ๋ก๋์์ต๋๋ค! ({0} โ develop)', github.head_ref) | |
| || format('์๋ก์ด PR์ด ๋ฑ๋ก๋์์ต๋๋ค! ({0} โ {1})', github.head_ref, github.base_ref) | |
| ) | |
| || 'Develop ๋ธ๋์น์ Push๊ฐ ์๋ฃ๋์์ต๋๋ค!' | |
| ) | |
| }}", | |
| "url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}", | |
| "color": 5814783, | |
| "fields": [ | |
| { | |
| "name": "Repository", | |
| "value": "${{ github.repository }}" | |
| }, | |
| { | |
| "name": "Branch", | |
| "value": "${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| run: | | |
| curl -X POST \ | |
| -H "Content-Type: application/json" \ | |
| -d "$DATA" \ | |
| $WEBHOOK_URL |