fix: remove .github directory from target repository #3
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: Sync to Forked Repository for Production Deployment | |
| on: | |
| push: | |
| branches: [main] # μ‘°μ§ λ ν¬ main λΈλμΉ μ λ°μ΄νΈ μ ν¬ν¬ λ ν¬μ λκΈ°ννμ¬ νλ‘λμ λ°°ν¬ | |
| jobs: | |
| sync-to-fork-for-production: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout organization repository main branch | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js environment for React build | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Build React application for production | |
| run: npm run build | |
| - name: Clone target repository | |
| run: | | |
| git clone https://x-access-token:${{ secrets.ZERO_GITHUB_KEY }}@github.com/0zuth/OneByOne_FE.git target-repo | |
| cd target-repo | |
| git config user.name "0zuth" | |
| git config user.email "${{ secrets.ZERO_ACCOUNT_EMAIL }}" | |
| - name: Push built files to forked repository (0zuth/OneByOne_FE) | |
| run: | | |
| # λΉλλ νμΌλ€λ§ λ³΅μ¬ (κΈ°μ‘΄ μμ€μ½λλ μ μ§) | |
| cp -r dist/* target-repo/ | |
| cd target-repo | |
| # .github λλ ν 리 μ κ±° (CI/CD μ€μ μ νκ² μ μ₯μμμ λΆνμ) | |
| rm -rf .github | |
| git add -A | |
| git status | |
| git commit -m "${{ github.event.commits[0].message }}" || echo "No changes to commit" | |
| git push https://x-access-token:${{ secrets.ZERO_GITHUB_KEY }}@github.com/0zuth/OneByOne_FE.git main | |
| env: | |
| GIT_AUTHOR_NAME: "0zuth" | |
| GIT_AUTHOR_EMAIL: "${{ secrets.ZERO_ACCOUNT_EMAIL }}" | |
| GIT_COMMITTER_NAME: "0zuth" | |
| GIT_COMMITTER_EMAIL: "${{ secrets.ZERO_ACCOUNT_EMAIL }}" | |
| continue-on-error: true | |
| - name: Confirm successful sync to forked repository for Vercel deployment | |
| run: echo "β Successfully synced to forked repository (0zuth/OneByOne_FE)" |