diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1d9b453 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,92 @@ +name: ci + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + cache: "pnpm" + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Check project + id: check_step + run: pnpm run lint && pnpm run typecheck + continue-on-error: true + + - name: Build project + id: build_step + run: pnpm run build + continue-on-error: true + + - name: Output build result + if: github.event_name == 'pull_request' && always() + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: build-result + message: | + ### ๐Ÿš€ ๋นŒ๋“œ ๊ฒฐ๊ณผ + ${{ steps.check_step.outcome == 'success' && '๐Ÿฉต ๋ฆฐํŠธ ๊ฒ€์‚ฌ ์™„๋ฃŒ' || '๐Ÿ˜ฅ ๋ฆฐํŠธ ๊ฒ€์‚ฌ ์‹คํŒจ' }} + ${{ steps.build_step.outcome == 'success' && '๐Ÿ’™ ๋นŒ๋“œ ์„ฑ๊ณต' || '๐Ÿ˜ญ ๋นŒ๋“œ ์‹คํŒจ' }} + +
+ โœ”๏ธ ๋กœ๊ทธ ํ™•์ธํ•˜๊ธฐ +
+ + Actions ํƒญ์—์„œ ์ž์„ธํžˆ ๋ณด๊ธฐ! + +
+ + - name: Notify Discord Alarm + if: github.event_name == 'pull_request' && always() + run: | + PR_TITLE="${{ github.event.pull_request.title }}" + PR_USER="${{ github.event.pull_request.user.login }}" + PR_URL="${{ github.event.pull_request.html_url }}" + + if [ "${{ steps.build_step.outcome }}" == "success" ]; then + COLOR=3066993 + TITLE="๐Ÿ’™ ๋นŒ๋“œ ์„ฑ๊ณต" + else + COLOR=15158332 + TITLE="๐Ÿ˜ญ ๋นŒ๋“œ ์‹คํŒจ" + fi + + DESCRIPTION="๐Ÿ“„ Title : \`$PR_TITLE\`\n โœ๏ธ ์ž‘์„ฑ์ž : \`$PR_USER\`\n\n[๐Ÿ”Ž PR๋ณด๋Ÿฌ๊ฐ€๊ธฐ]($PR_URL)" + curl -H "Content-Type: application/json" \ + -d "{ + \"embeds\": [{ + \"title\": \"$TITLE\", + \"description\": \"$DESCRIPTION\", + \"color\": $COLOR + }] + }" \ + "${{ secrets.DISCORD_WEBHOOK_URL }}" + + - name: Check Build Status + if: steps.check_step.outcome == 'failure' || steps.build_step.outcome == 'failure' + run: exit 1 \ No newline at end of file diff --git a/.github/workflows/vercel-sync.yml b/.github/workflows/vercel-sync.yml new file mode 100644 index 0000000..fc9e2af --- /dev/null +++ b/.github/workflows/vercel-sync.yml @@ -0,0 +1,27 @@ +name: sync-fork-for-vercel-deploy + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: write + +jobs: + sync-fork: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.FORK_SYNC_TOKEN }} + + - name: Sync upstream -> fork (u-zzn) + uses: tgymnich/fork-sync@v2.3.1 + with: + github_token: ${{ secrets.FORK_SYNC_TOKEN }} + owner: u-zzn + base: main + head: main