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
42 changes: 15 additions & 27 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ jobs:
channel: ${{ steps.channel.outputs.channel }}

steps:
- name: Setup GNU tar (required for actions/upload-pages-artifact)
run: |
# macOS uses BSD tar by default, but upload-pages-artifact requires GNU tar (gtar)
if ! command -v gtar &> /dev/null; then
brew install gnu-tar
fi
echo "$(brew --prefix gnu-tar)/libexec/gnubin" >> $GITHUB_PATH

- name: Git checkout
run: |
if [ ! -d ".git" ]; then
Expand Down Expand Up @@ -176,10 +168,19 @@ jobs:
cp release/bfmpay-dweb-beta.zip "release/bfmpay-dweb-${VERSION}-beta.zip"
fi

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: gh-pages
# 直接推送到 gh-pages 分支,避免使用 upload-pages-artifact(self-hosted 上容易卡住)
- 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"

# 直接在 build job 中创建 release,避免跨 job 传递 artifact(self-hosted 下载很慢)
- name: Create or Update Release
Expand Down Expand Up @@ -426,21 +427,8 @@ jobs:
path: release/
retention-days: 30

# ==================== 部署到 GitHub Pages ====================
deploy-pages-fast:
if: vars.USE_SELF_HOSTED == 'true'
needs: build-fast
runs-on: self-hosted

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

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

# ==================== 部署到 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
Expand Down