-
Notifications
You must be signed in to change notification settings - Fork 0
Release: static blog scaffold + auto-publish CI #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Generate & Publish | ||
|
|
||
| # Builds the static site from posts/ and publishes it to GitHub Pages. | ||
| # | ||
| # Triggers: | ||
| # - daily on a schedule (so AI-generated posts go live automatically) | ||
| # - on push to main (the production branch) | ||
| # - manually via the Actions tab | ||
| # | ||
| # Note: develop is the integration branch; publishing happens from main. | ||
| # Merge develop -> main to release. | ||
|
|
||
| on: | ||
| schedule: | ||
| # 23:17 UTC daily (~07:17 Asia/Shanghai). Off the :00 mark on purpose. | ||
| - cron: "17 23 * * *" | ||
| push: | ||
| branches: ["main"] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| # Allow only one concurrent deployment. | ||
| concurrency: | ||
| group: "pages" | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "20" | ||
| cache: "npm" | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build site | ||
| run: npm run build | ||
|
|
||
| - name: Upload Pages artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: public | ||
|
|
||
| deploy: | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build output (regenerated by scripts/build.mjs) | ||
| public/ | ||
|
|
||
| # Logs / OS cruft | ||
| *.log | ||
| .DS_Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,27 +60,59 @@ OpenBlog 用 AI Agent 把这条链路自动化: | |
|
|
||
| ## 项目状态 | ||
|
|
||
| > ⚠️ **早期阶段(Scaffold)** | ||
| > 🚧 **早期可用(Early / MVP)** | ||
| > | ||
| > 当前仓库处于初始搭建阶段,尚未包含完整的应用代码与生成/发布流水线。 | ||
| > 上面描述的是项目的**目标定位与设计蓝图**,功能正在逐步落地。 | ||
| > 已具备一条可运行的静态站点流水线:`posts/` 里的 Markdown 文章会被生成器渲染成站点,并由 CI 定时构建、自动发布到 GitHub Pages。AI 自动撰写文章的环节正在逐步接入。 | ||
|
|
||
| ### 路线图(Roadmap) | ||
|
|
||
| - [x] 静态站点生成器(Markdown → HTML) | ||
| - [x] 自动构建与发布(GitHub Pages,定时 + 触发) | ||
| - [ ] 记忆采集与结构化存储 | ||
| - [ ] AI 文章生成流水线 | ||
| - [ ] 自动构建与发布 | ||
| - [ ] 定时 / 触发式自动运行 | ||
| - [ ] AI 文章生成流水线(由记忆自动撰写) | ||
| - [ ] 站点主题与个人化配置 | ||
|
|
||
| ## 快速开始 | ||
|
|
||
| ```bash | ||
| git clone https://github.com/xiami303/OpenBlog.git | ||
| cd OpenBlog | ||
| npm install # 安装依赖 | ||
| npm run build # 渲染 posts/ → public/ | ||
| npm run serve # 构建并本地预览 http://localhost:8080 | ||
| ``` | ||
|
|
||
| > 构建与运行命令将随功能落地补充。当前仓库尚无构建工具链 —— 详见 [AGENTS.md](AGENTS.md)。 | ||
| ### 写一篇文章 | ||
|
|
||
| 在 `posts/` 下新建一个 `.md` 文件(文件名即文章 URL slug),开头写好 front matter: | ||
|
|
||
| ```markdown | ||
| --- | ||
| title: 我的想法 | ||
| date: 2026-06-11 | ||
| tags: [memory, ai] | ||
| summary: 显示在首页的一句话简介。 | ||
| --- | ||
|
|
||
| # 我的想法 | ||
| ... | ||
| ``` | ||
|
|
||
| 所有字段都可省略 —— 没有 title 就用第一个标题或文件名,没有 date 就用文件修改时间。运行 `npm run build` 后,文章就会出现在站点上。 | ||
|
|
||
| ## 目录结构 | ||
|
|
||
| ``` | ||
| posts/ # Markdown 文章(内容源) | ||
| scripts/build.mjs # 静态站点生成器 | ||
| public/ # 构建产物(自动生成,已 gitignore) | ||
| .github/workflows/ # 定时生成 + 自动发布到 Pages | ||
| ``` | ||
|
Comment on lines
+103
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing language specifier on fenced code block. The fenced code block at line 105 should specify a language for proper syntax highlighting and linting compliance. 📝 Proposed fix-```
+```plaintext
posts/ # Markdown 文章(内容源)
scripts/build.mjs # 静态站点生成器
public/ # 构建产物(自动生成,已 gitignore)
.github/workflows/ # 定时生成 + 自动发布到 Pages🧰 Tools🪛 markdownlint-cli2 (0.22.1)[warning] 105-105: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
|
|
||
| ## 分支规则 | ||
|
|
||
| - **`develop`** —— 集成分支,**日常开发与提交的默认分支**。 | ||
| - **`main`** —— 生产 / 已发布分支,CI 从这里部署到 Pages。仅在发布时把 `develop` 合并到 `main`。 | ||
|
|
||
| ## 参与开发 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing language specifier on fenced code block.
The fenced code block at line 17 should specify a language for proper syntax highlighting and linting compliance.
📝 Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 17-17: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents