feat(ci): 支持禁用 GitHub Pages 部署
为 GitHub Pages 部署步骤添加条件判断,通过 ENABLE_GITHUB_PAGES 变量控制
This commit is contained in:
10
.github/workflows/deploy.yml
vendored
10
.github/workflows/deploy.yml
vendored
@@ -128,17 +128,25 @@ jobs:
|
||||
else
|
||||
echo "Warning: favicon.ico not found in dist directory"
|
||||
# 暂时改为警告,避免因为图标问题阻止部署
|
||||
# exit 1
|
||||
# exit 1
|
||||
fi
|
||||
|
||||
# GitHub Pages 部署步骤(仅在启用时执行)
|
||||
# 说明:
|
||||
# - 如果你使用 Vercel/Cloudflare Pages 等第三方平台部署,可以跳过这些步骤
|
||||
# - 设置 repository variable ENABLE_GITHUB_PAGES=false 来禁用 GitHub Pages 部署
|
||||
# - 默认启用 GitHub Pages 部署以保持向后兼容
|
||||
- name: Setup Pages
|
||||
if: ${{ vars.ENABLE_GITHUB_PAGES != 'false' }}
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
- name: Upload artifact
|
||||
if: ${{ vars.ENABLE_GITHUB_PAGES != 'false' }}
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: 'dist'
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
if: ${{ vars.ENABLE_GITHUB_PAGES != 'false' }}
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
Reference in New Issue
Block a user