diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..71fba07 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,50 @@ +# 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: + 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