Skip to content

Commit fdf0f53

Browse files
claudejsshin2022
authored andcommitted
Deploy book with actions/deploy-pages instead of pushing to gh-pages
The push to gh-pages is rejected by branch protection (GH006), so the merged book never got published. Upload the build as a Pages artifact and deploy it directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WELSFHaGT1Gh5sSRyUvAMx
1 parent 412324c commit fdf0f53

1 file changed

Lines changed: 19 additions & 8 deletions

File tree

‎.github/workflows/book.yml‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
workflow_dispatch:
99

1010
permissions:
11-
contents: write
11+
contents: read
12+
pages: write
13+
id-token: write
1214

1315
concurrency:
1416
group: book-${{ github.ref }}
@@ -47,12 +49,21 @@ jobs:
4749
path: book/_book
4850
retention-days: 7
4951

50-
- name: Deploy to GitHub Pages
52+
# gh-pages 브랜치에 push하지 않고 Pages에 직접 배포합니다(브랜치 보호 규칙과 무관).
53+
- name: Upload Pages artifact
5154
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
52-
uses: peaceiris/actions-gh-pages@v4
55+
uses: actions/upload-pages-artifact@v3
5356
with:
54-
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
publish_dir: book/_book
56-
publish_branch: gh-pages
57-
force_orphan: true
58-
commit_message: "Deploy book"
57+
path: book/_book
58+
59+
deploy:
60+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
61+
needs: build
62+
runs-on: ubuntu-latest
63+
environment:
64+
name: github-pages
65+
url: ${{ steps.deployment.outputs.page_url }}
66+
steps:
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)