Skip to content

fix: remove .github directory from target repository #3

fix: remove .github directory from target repository

fix: remove .github directory from target repository #3

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)"