Skip to content

Commit d31e653

Browse files
authored
Merge pull request #12 from toothlessdev/publish
docs: 프론트엔드에서 원자성 보장하기 (feat. 대용량 데이터 배치 업로드)
2 parents 1820952 + ec56d6f commit d31e653

File tree

23 files changed

+349
-253
lines changed

23 files changed

+349
-253
lines changed

.github/workflows/deploy.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ permissions:
99
contents: read
1010
pages: write
1111
id-token: write
12+
pull-requests: write
1213

1314
concurrency:
1415
group: pages
1516
cancel-in-progress: false
1617

1718
jobs:
1819
build:
20+
name: Build
1921
runs-on: ubuntu-latest
2022
steps:
2123
- name: Checkout
@@ -53,13 +55,47 @@ jobs:
5355
path: .vitepress/dist
5456

5557
deploy:
58+
name: Deploy
5659
environment:
5760
name: github-pages
5861
url: ${{ steps.deployment.outputs.page_url }}
5962
needs: build
6063
runs-on: ubuntu-latest
61-
name: Deploy
64+
outputs:
65+
page_url: ${{ steps.deployment.outputs.page_url }}
6266
steps:
6367
- name: Deploy to GitHub Pages
6468
id: deployment
6569
uses: actions/deploy-pages@v4
70+
71+
update-pr-body:
72+
name: Update PR Body
73+
needs: deploy
74+
runs-on: ubuntu-latest
75+
if: github.event.head_commit.message != '' && contains(github.event.head_commit.message, 'Merge pull request')
76+
steps:
77+
- name: Find Pull Request Number
78+
id: find_pr
79+
run: |
80+
PR_NUMBER=$(echo "${{ github.event.head_commit.message }}" | sed -n 's/.*Merge pull request #\([0-9]\+\).*/\1/p')
81+
if [ -z "$PR_NUMBER" ]; then
82+
echo "Could not find PR number in commit message."
83+
exit 1
84+
fi
85+
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
86+
87+
- name: Update Pull Request Body
88+
env:
89+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
PR_NUMBER: ${{ steps.find_pr.outputs.PR_NUMBER }}
91+
PAGE_URL: ${{ needs.deploy.outputs.page_url }}
92+
run: |
93+
export BODY=$(gh pr view $PR_NUMBER --json body -q .body)
94+
export HEADER="🚀 **배포 완료!**\n**배포된 사이트:** [${PAGE_URL}](${PAGE_URL})"
95+
gh pr edit $PR_NUMBER --body-file - <<EOF
96+
${HEADER}
97+
98+
---
99+
100+
${BODY}
101+
EOF
115 KB
Loading
135 KB
Loading
58.1 KB
Loading
209 KB
Loading
476 KB
Loading
95.8 KB
Loading
83.9 KB
Loading
89.3 KB
Loading
38.6 KB
Loading

0 commit comments

Comments
 (0)