-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
name: Clone Repository on Build Branch Push | ||
name: Push Build Files to Wanna-Woowa-Blog Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- build | ||
- build # build 브랜치에 푸시될 때 트리거 | ||
|
||
jobs: | ||
clone_repo: | ||
deploy_to_blog: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
# 1. 현재 A 레포지토리의 build 브랜치 체크아웃 | ||
- name: Checkout the build branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: build # build 브랜치 체크아웃 | ||
|
||
- name: Clone the repository to personal account | ||
# 2. wanna-woowa-blog 레포지토리 클론 | ||
- name: Clone the wanna-woowa-blog repository | ||
run: | | ||
git clone https://${{ secrets.LURGI_PERSONAL_ACCESS_TOKEN }}@github.com/lurgi/wanna-woowa-blog.git | ||
cd wanna-woowa-blog | ||
# 3. build 파일들을 wanna-woowa-blog로 복사 | ||
- name: Copy build files to wanna-woowa-blog | ||
run: | | ||
cp -r ../build/* ./ # build 폴더에서 모든 파일을 복사 | ||
# 4. 변경된 파일 커밋 및 푸시 | ||
- name: Commit and push changes to wanna-woowa-blog main | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "your-username" | ||
git add . | ||
git commit -m "Deploying build files from build branch" | ||
git push https://${{ secrets.LURGI_PERSONAL_ACCESS_TOKEN }}@github.com/lurgi/wanna-woowa-blog.git main |