Skip to content

Commit 979a26f

Browse files
author
Dr. Awesome Doge
committed
fix: 恢復使用 peaceiris/actions-gh-pages 部署以修復 404 問題
問題原因: - 使用 actions/deploy-pages 部署時,部分頁面(如 /bitcoin/tutorial/* 路徑) 出現 404 錯誤 - 這是由於 workflow deployment 與 gh-pages 分支部署之間的衝突 修復方式: - 恢復使用 peaceiris/actions-gh-pages 部署到 gh-pages 分支 - 保留 workflow_dispatch 支持手動觸發 - PR 時仍上傳 artifact 供 quality checks 使用
1 parent bb76bef commit 979a26f

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

.github/workflows/run.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,21 @@ jobs:
7070
- name: Build Pagefind search index
7171
run: npx pagefind --site _site --output-path _site/pagefind
7272

73-
- name: Upload artifact
73+
- name: Upload artifact for PR checks
74+
if: github.event_name == 'pull_request'
7475
uses: actions/upload-pages-artifact@v3
7576
with:
7677
path: ./_site
7778

78-
deploy:
79-
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'cypherpunks-core/cypherpunks-core.github.io'
80-
needs: build
81-
runs-on: ubuntu-latest
82-
permissions:
83-
pages: write
84-
id-token: write
85-
environment:
86-
name: github-pages
87-
url: ${{ steps.deployment.outputs.page_url }}
88-
steps:
8979
- name: Deploy to GitHub Pages
90-
id: deployment
91-
uses: actions/deploy-pages@v4
80+
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' && github.repository == 'cypherpunks-core/cypherpunks-core.github.io'
81+
uses: peaceiris/actions-gh-pages@v4
82+
with:
83+
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
publish_dir: ./_site
85+
publish_branch: gh-pages
86+
user_name: 'github-actions[bot]'
87+
user_email: 'github-actions[bot]@users.noreply.github.com'
9288

9389
# Quality Checks (run on PRs)
9490
quality-check:

0 commit comments

Comments
 (0)