From 7ee4b2cd554581f7ad056ee3d9d7b75939d6d247 Mon Sep 17 00:00:00 2001 From: zrr1999 <2742392377@qq.com> Date: Wed, 29 Apr 2026 17:26:50 +0800 Subject: [PATCH 1/6] chore: migrate domains and quality checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/styles/Sixbones/Terms.yml | 8 +++ .github/workflows/ci-links.yml | 43 ++++++++++++ .github/workflows/ci-typos.yml | 40 +++++++++++ .github/workflows/ci-vale.yml | 44 ++++++++++++ .github/workflows/ci-workflow-validation.yml | 29 ++++++++ .github/workflows/deploy.yml | 69 ------------------- .vale.ini | 5 ++ AGENTS.md | 31 +++++++-- README.md | 43 ++++++++++-- _typos.toml | 24 +++++++ apps/blog/data/blog/all-in-one.md | 2 +- apps/blog/data/blog/egglog-quickstart-01.md | 2 +- apps/blog/data/blog/egglog-quickstart-02.md | 2 +- apps/blog/data/blog/egglog-quickstart-03.md | 2 +- apps/blog/data/blog/eq-type-lsp.md | 2 +- apps/blog/data/blog/gaokao-math-formulas.md | 2 +- apps/blog/data/blog/incus-qcow2.md | 2 +- apps/blog/data/blog/linux-gateway.md | 2 +- .../data/blog/multi-agent-design-paradigms.md | 2 +- apps/blog/data/blog/openprose-case-study.md | 2 +- apps/blog/data/blog/pycapsule-dlpack.md | 2 +- apps/blog/data/blog/pytest-introduction.md | 2 +- apps/blog/data/blog/rational-decomposition.md | 2 +- apps/blog/data/blog/simple-cache.typ | 2 +- apps/blog/data/blog/sparse-tensor.md | 2 +- apps/blog/data/blog/welford-algorithm.md | 2 +- apps/blog/src/config.ts | 6 +- apps/blog/src/pages/index.astro | 2 +- apps/root/astro.config.mjs | 2 +- apps/root/src/components/Layout.astro | 4 +- apps/root/src/pages/index.astro | 10 +-- apps/slides/astro.config.mjs | 2 +- apps/slides/src/layouts/Layout.astro | 4 +- vite.config.ts | 3 +- 34 files changed, 287 insertions(+), 114 deletions(-) create mode 100644 .github/styles/Sixbones/Terms.yml create mode 100644 .github/workflows/ci-links.yml create mode 100644 .github/workflows/ci-typos.yml create mode 100644 .github/workflows/ci-vale.yml create mode 100644 .github/workflows/ci-workflow-validation.yml delete mode 100644 .github/workflows/deploy.yml create mode 100644 .vale.ini create mode 100644 _typos.toml diff --git a/.github/styles/Sixbones/Terms.yml b/.github/styles/Sixbones/Terms.yml new file mode 100644 index 0000000..9a246c3 --- /dev/null +++ b/.github/styles/Sixbones/Terms.yml @@ -0,0 +1,8 @@ +extends: substitution +message: "Use '%s' instead of '%s'." +level: error +ignorecase: false +swap: + Github: GitHub + Javascript: JavaScript + Typescript: TypeScript diff --git a/.github/workflows/ci-links.yml b/.github/workflows/ci-links.yml new file mode 100644 index 0000000..7aa043d --- /dev/null +++ b/.github/workflows/ci-links.yml @@ -0,0 +1,43 @@ +name: "CI - Link Checks" + +on: + push: + branches: + - main + paths: + - "apps/blog/data/blog/**/*.md" + - "hosting/**/*.md" + pull_request: + branches: + - main + paths: + - "apps/blog/data/blog/**/*.md" + - "hosting/**/*.md" + workflow_dispatch: + +permissions: + contents: read + +jobs: + links: + name: links + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Check links with lychee + uses: lycheeverse/lychee-action@v2 + with: + args: >- + --accept 429 + --exclude-loopback + --no-progress + 'apps/blog/data/blog/**/*.md' + 'hosting/**/*.md' + fail: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-typos.yml b/.github/workflows/ci-typos.yml new file mode 100644 index 0000000..e746843 --- /dev/null +++ b/.github/workflows/ci-typos.yml @@ -0,0 +1,40 @@ +name: "CI - Typos" + +on: + push: + branches: + - main + paths: + - ".github/**" + - "_typos.toml" + - "apps/blog/data/blog/**" + - "hosting/README.md" + pull_request: + branches: + - main + paths: + - ".github/**" + - "_typos.toml" + - "apps/blog/data/blog/**" + - "hosting/README.md" + workflow_dispatch: + +permissions: + contents: read + +jobs: + typos: + name: typos + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Run typos + uses: crate-ci/typos-action@v1 + with: + config: ./_typos.toml + files: ".github apps/blog/data/blog hosting/README.md" diff --git a/.github/workflows/ci-vale.yml b/.github/workflows/ci-vale.yml new file mode 100644 index 0000000..bd147b3 --- /dev/null +++ b/.github/workflows/ci-vale.yml @@ -0,0 +1,44 @@ +name: "CI - Vale" + +on: + push: + branches: + - main + paths: + - ".vale.ini" + - ".github/styles/**" + - "apps/blog/data/blog/**/*.md" + - "hosting/**/*.md" + pull_request: + branches: + - main + paths: + - ".vale.ini" + - ".github/styles/**" + - "apps/blog/data/blog/**/*.md" + - "hosting/**/*.md" + workflow_dispatch: + +permissions: + contents: read + checks: write + +jobs: + vale: + name: vale + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Run Vale + uses: vale-cli/vale-action@v2.1.1 + with: + files: '["apps/blog/data/blog", "hosting"]' + reporter: github-check + fail_on_error: true + filter_mode: nofilter + vale_flags: "--glob=*.md" diff --git a/.github/workflows/ci-workflow-validation.yml b/.github/workflows/ci-workflow-validation.yml new file mode 100644 index 0000000..f10ae2b --- /dev/null +++ b/.github/workflows/ci-workflow-validation.yml @@ -0,0 +1,29 @@ +name: "CI - Workflow Validation" + +on: + push: + branches: + - main + paths: + - ".github/workflows/**" + pull_request: + branches: + - main + paths: + - ".github/workflows/**" + workflow_dispatch: + +permissions: + contents: read + +jobs: + actionlint: + name: actionlint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Run actionlint + uses: rhysd/actionlint@v1 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 5f1d1e6..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Deploy to Vercel - -on: - push: - branches: [main] - pull_request: - branches: [main] - workflow_dispatch: - -permissions: - contents: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v6 - with: - submodules: recursive - - name: Setup pnpm - uses: pnpm/action-setup@v6 - - name: Setup Node.js - uses: actions/setup-node@v6 - with: - node-version: "24" - cache: "pnpm" - - name: Install and Build 🔧 - run: | - pnpm install - pnpm run build - - name: Create blog domain branch 🌿 - if: github.event_name != 'pull_request' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./apps/blog/dist/ - publish_branch: blog - force_orphan: true - commit_message: ":rocket: deploy: " - user_name: "github-actions" - user_email: "github-actions@github.com" - - name: Create slides domain branch 🌿 - if: github.event_name != 'pull_request' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./apps/slides/dist/ - publish_branch: slides - force_orphan: true - commit_message: ":rocket: deploy: " - user_name: "github-actions" - user_email: "github-actions@github.com" - - name: Create root domain branch 🌿 - if: github.event_name != 'pull_request' - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./apps/root/dist/ - publish_branch: root - force_orphan: true - commit_message: ":rocket: deploy: " - user_name: "github-actions" - user_email: "github-actions@github.com" diff --git a/.vale.ini b/.vale.ini new file mode 100644 index 0000000..8753d3c --- /dev/null +++ b/.vale.ini @@ -0,0 +1,5 @@ +StylesPath = .github/styles +MinAlertLevel = error + +[*.md] +BasedOnStyles = Sixbones diff --git a/AGENTS.md b/AGENTS.md index 511bd04..e5fcb74 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,9 +4,9 @@ AI 代理配置、工作流程与项目规范。项目概览见 [README](./READM ## 项目结构 -- `apps/root/` - 个人主页(sixbones.dev) -- `apps/blog/` - 博客(blog.sixbones.dev) -- `apps/slides/` - 幻灯片(slides.sixbones.dev) +- `apps/root/` - 个人主页(`zrr.dev`,`sixbones.dev` 永久重定向到此) +- `apps/blog/` - 博客(`blog.zrr.dev`,`blog.sixbones.dev` 永久重定向到此) +- `apps/slides/` - 幻灯片(`slides.zrr.dev`,`slides.sixbones.dev` 永久重定向到此) ## 可用代理 @@ -46,7 +46,7 @@ AI 代理配置、工作流程与项目规范。项目概览见 [README](./READM ## 配置 - `package.json` / `turbo.json` - 依赖与构建 -- `.github/workflows/` - CI/CD +- `.github/workflows/` - CI / 校验(不负责生产部署) - `.github/agents/` - 代理配置(若存在) ## 常用命令 @@ -75,6 +75,13 @@ AI 代理配置、工作流程与项目规范。项目概览见 [README](./READM - 遵循常规提交规范,单次提交保持最小化 - 审查代理更改时验证测试通过、文档同步 +## 部署模型 + +- 生产环境使用 Cloudflare Pages 原生 Git 集成,直接跟踪 `main` 分支。 +- 不要重新引入 GitHub Actions + orphan branch、Wrangler secrets 或其他仓库内发布步骤来做生产部署。 +- 预期存在 3 个 Cloudflare Pages 项目,分别对应 `apps/root`、`apps/blog`、`apps/slides`;构建命令与输出目录以 [README](./README.md#部署模型) 为准。 +- 旧域名 `sixbones.dev`、`blog.sixbones.dev`、`slides.sixbones.dev` 必须继续保留为 `308` 永久重定向入口,并将请求转发到新的公开域名。 + ## 博客编写规范 文章位于 `apps/blog/data/blog/`,使用 Markdown。 @@ -184,14 +191,26 @@ These commands map to their corresponding tools. For example, `vp dev --port 300 - **Using the package manager directly:** Do not use pnpm, npm, or Yarn directly. Vite+ can handle all package manager operations. - **Always use Vite commands to run tools:** Don't attempt to run `vp vitest` or `vp oxlint`. They do not exist. Use `vp test` and `vp lint` instead. -- **Running scripts:** Vite+ commands take precedence over `package.json` scripts. If there is a `test` script defined in `scripts` that conflicts with the built-in `vp test` command, run it using `vp run test`. +- **Running scripts:** Vite+ built-in commands (`vp dev`, `vp build`, `vp test`, etc.) always run the Vite+ built-in tool, not any `package.json` script of the same name. To run a custom script that shares a name with a built-in command, use `vp run