mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-08-07 06:33:58 +08:00
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
# GitHub Pages 部署(Actions 模式)
|
||
# 替代 legacy 分支构建:构建过程可见、失败有日志,避免服务端队列黑盒卡死。
|
||
# 输出与 legacy 完全一致(同为官方 Jekyll 构建器渲染 docs/)。
|
||
name: Pages
|
||
|
||
on:
|
||
push:
|
||
branches: [main]
|
||
paths:
|
||
- "docs/**"
|
||
- ".github/workflows/pages.yml"
|
||
workflow_dispatch:
|
||
|
||
permissions:
|
||
contents: read
|
||
pages: write
|
||
id-token: write
|
||
|
||
# 同一时间只保留最新一次部署,取消进行中的旧部署
|
||
concurrency:
|
||
group: pages
|
||
cancel-in-progress: true
|
||
|
||
jobs:
|
||
build:
|
||
if: ${{ github.event_name != 'workflow_dispatch' || github.ref == 'refs/heads/main' }}
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- name: 签出代码
|
||
uses: actions/checkout@v4
|
||
- name: 配置 Pages
|
||
id: pages
|
||
uses: actions/configure-pages@v5
|
||
- name: Jekyll 构建
|
||
uses: actions/jekyll-build-pages@v1
|
||
with:
|
||
source: ./docs
|
||
destination: ./_site
|
||
- name: 上传站点产物
|
||
uses: actions/upload-pages-artifact@v3
|
||
|
||
deploy:
|
||
environment:
|
||
name: github-pages
|
||
url: ${{ steps.deployment.outputs.page_url }}
|
||
runs-on: ubuntu-latest
|
||
needs: build
|
||
steps:
|
||
- name: 部署到 GitHub Pages
|
||
id: deployment
|
||
uses: actions/deploy-pages@v4
|