-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (39 loc) · 1.26 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Synchronize to Forked Repo
on:
push:
branches:
- develop
- main
repository_dispatch: # 원본 레포에서 이벤트 발생 시 실행되도록 설정
types: [sync-fork]
jobs:
sync:
name: Sync to Forked Repo
runs-on: ubuntu-latest
steps:
- name: Checkout forked repo
uses: actions/checkout@v4
with:
token: ${{ secrets.AUTO_ACTIONS }}
fetch-depth: 0
- name: Determine target branch
id: vars
run: |
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
echo "TARGET_BRANCH=develop" >> $GITHUB_ENV
else
echo "TARGET_BRANCH=main" >> $GITHUB_ENV
fi
- name: Configure Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Add upstream repository (original repo)
run: |
git remote add upstream https://github.com/DguFarmSystem/HomePage-FE.git
git fetch upstream
- name: Merge upstream changes into forked repo
run: |
git checkout ${{ env.TARGET_BRANCH }}
git merge --no-edit upstream/${{ env.TARGET_BRANCH }}
git push origin ${{ env.TARGET_BRANCH }}