Skip to content

Commit 6ea1bb2

Browse files
authored
Merge pull request #7 from DguFarmSystem/setting/#6
setting: develop 브랜치 자동 배포(Pull Request 프리뷰) 설정 추가
2 parents 47fc56a + 6a79cac commit 6ea1bb2

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

github/workflows/deploy.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,35 @@ on:
44
push:
55
branches:
66
- main # main 브랜치에 push 발생 시 실행
7+
- develop # develop 브랜치에 push 발생 시 실행
78

89
jobs:
910
sync:
1011
name: Sync forked repo
11-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-latest # GitHub Actions 가상 환경
1213

1314
steps:
14-
- name: Checkout main
15+
- name: Checkout current branch
1516
uses: actions/checkout@v4
1617
with:
1718
token: ${{ secrets.AUTO_ACTIONS }}
1819
fetch-depth: 0
19-
ref: main
20+
21+
- name: Determine target branch
22+
id: vars
23+
run: |
24+
BRANCH=$(basename "${{ github.ref }}")
25+
echo "TARGET_BRANCH=$BRANCH" >> $GITHUB_ENV
2026
2127
- name: Add remote-url
2228
run: |
23-
git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/FarmingLong-FE
29+
git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/FarmingLog-FE
2430
git config user.name dewbeeny
2531
git config user.email ${{ secrets.EMAIL }}
2632
2733
- name: Push changes to forked-repo
2834
run: |
29-
git push -f forked-repo main
30-
35+
git push -f forked-repo ${{ env.TARGET_BRANCH }}
3136
- name: Clean up
3237
run: |
3338
git remote remove forked-repo

0 commit comments

Comments
 (0)