Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,19 @@ jobs:
bun scripts/build.ts dweb --upload --skip-typecheck --skip-test
fi

# ===== 上传构建产物 =====
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: gh-pages
# ===== 部署到 GitHub Pages (Force Push) =====
- name: Deploy to GitHub Pages
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
cd gh-pages
git init
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "Deploy to GitHub Pages - ${{ github.sha }}"
git push -f "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" HEAD:gh-pages
echo "Deployed to gh-pages branch"

- name: Upload release artifacts
uses: actions/upload-artifact@v4
Expand All @@ -462,22 +470,6 @@ jobs:
path: release/
retention-days: 30

# ==================== 部署到 GitHub Pages (GitHub-hosted only) ====================
# Self-hosted 版本直接在 build-fast 中用 git push 部署,避免 upload-pages-artifact 卡住
deploy-pages-standard:
if: vars.USE_SELF_HOSTED != 'true'
needs: build-standard
runs-on: ubuntu-latest

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

# ==================== 创建 Release (GitHub-hosted) ====================
create-release-standard:
if: vars.USE_SELF_HOSTED != 'true'
Expand Down