diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..fb53a20 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,51 @@ +name: Biome CI for React + +on: + pull_request: + branches: [main, develop] + push: + branches: [main, develop] + +jobs: + check-project: + runs-on: ubuntu-latest + + steps: + - name: πŸ“₯ Checkout code + uses: actions/checkout@v4 + + - name: 🟒 Setup Node + uses: actions/setup-node@v3 + with: + node-version: 22.x + + - name: πŸ“¦ Install dependencies + run: npm ci + + - name: πŸ”Ž Run Biome Check + run: npm run check + + - name: πŸ—οΈ Build Project + run: npm run build + + - name: Install mustache (to update the date) + run: apk add ruby && gem install mustache + + - name: creates output + run: sh ./build.sh + # Build ν›„ λ‹€λ₯Έ λ ˆν¬μ§€ν† λ¦¬λ‘œ ν‘Έμ‹œ + - name: Push to Another Repository + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }} + with: + source-directory: 'output' + destination-github-username: two678 # λ‚΄ GitHub 계정 + destination-repository-name: Fandom-K # ν‘Έμ‹œν•  λ ˆν¬μ§€ν† λ¦¬ 이름 + user-email: ${{ secrets.EMAIL }} # 이메일 (GitHub Secrets둜 μ €μž₯된 이메일) + commit-message: ${{ github.event.commits[0].message }} + target-branch: main # ν‘Έμ‹œν•  브랜치 + + # (μ˜΅μ…˜) ν‘Έμ‹œ ν›„ λ‹€λ₯Έ μž‘μ—…μ„ μœ„ν•œ λ³€μˆ˜ 좜λ ₯ (디버깅 μš©λ„) + - name: Test get variable exported by push-to-another-repository + run: echo $DESTINATION_CLONED_DIRECTORY diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 2765267..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Biome CI for React - -on: - pull_request: - branches: [main, dev] - push: - branches: [main, dev] - -jobs: - check-project: - runs-on: ubuntu-latest - - steps: - - name: πŸ“₯ Checkout code - uses: actions/checkout@v4 - - - name: 🟒 Setup Node - uses: actions/setup-node@v3 - with: - node-version: 22.x - - - name: πŸ“¦ Install dependencies - run: npm ci - - - name: πŸ”Ž Run Biome Check - run: npm run check - - - name: πŸ§ͺ Run Tests (optional) - run: npm test - - - name: πŸ—οΈ Build Project - run: npm run build diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..8bea345 --- /dev/null +++ b/build.sh @@ -0,0 +1,5 @@ +#!/bin/sh +cd ../ +mkdir output +cp -R ./Fandom-K/* ./output +cp -R ./output ./Fandom-K/ \ No newline at end of file