From f7bfcf5c8344734635113a1dec8d8b91a17ba062 Mon Sep 17 00:00:00 2001 From: dewbeeny Date: Tue, 25 Feb 2025 01:00:04 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EA=B8=B0=EC=A1=B4=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=EC=97=90=20develop=20=EB=B8=8C=EB=9E=9C=EC=B9=98?= =?UTF-8?q?=EB=A7=8C=20=EC=B6=94=EA=B0=80=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++++++++ .github/workflows/sync-to-fork.yml | 32 ------------------------- 2 files changed, 38 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/sync-to-fork.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..db53682 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,38 @@ +name: Synchronize to forked repo + +on: + push: + branches: + - main # main 브랜치에 push 발생 시 실행 + - develop # develop 브랜치에 push 발생 시 실행 + +jobs: + sync: + name: Sync forked repo + runs-on: ubuntu-latest # GitHub Actions 가상 환경 + + steps: + - name: Checkout current branch + uses: actions/checkout@v4 + with: + token: ${{ secrets.AUTO_ACTIONS }} + fetch-depth: 0 + + - name: Determine target branch + id: vars + run: | + BRANCH=$(basename "${{ github.ref }}") + echo "TARGET_BRANCH=$BRANCH" >> $GITHUB_ENV + + - name: Add remote-url + run: | + git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/HomePage-FE + git config user.name dewbeeny + git config user.email ${{ secrets.EMAIL }} + + - name: Push changes to forked-repo + run: | + git push -f forked-repo ${{ env.TARGET_BRANCH }} + - name: Clean up + run: | + git remote remove forked-repo diff --git a/.github/workflows/sync-to-fork.yml b/.github/workflows/sync-to-fork.yml deleted file mode 100644 index 368e338..0000000 --- a/.github/workflows/sync-to-fork.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Sync Changes to Forked Repo - -on: - push: - branches: - - develop - - main - -jobs: - sync: - name: Sync with Forked Repo - runs-on: ubuntu-latest - - steps: - - name: Checkout Source Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - - name: Add Forked Repo as Remote - run: | - git remote add forked https://x-access-token:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/HomePage-FE.git - git fetch forked - - - name: Push Changes to Forked Repo - run: | - git push -f forked develop