diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 6a441788..8cf1f448 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -7,6 +7,6 @@
> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
> If a modification is not involved, please skip it directly.
-- [ ] If it's a extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
-- [ ] If you changed the behavior of static-php-cli, add docs in [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) .
-- [ ] If you updated `config/xxxx.json` content, run `bin/spc dev:sort-config xxx`.
+- [ ] If it's an extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`.
+- [ ] If you changed the behavior of static-php-cli, update docs in `./docs/`.
+- [ ] If you updated `config/xxx.json` content, run `bin/spc dev:sort-config xxx`.
diff --git a/.github/workflows/update-docs-config.yml b/.github/workflows/vitepress-deploy.yml
similarity index 56%
rename from .github/workflows/update-docs-config.yml
rename to .github/workflows/vitepress-deploy.yml
index d3687b42..8ad3baee 100644
--- a/.github/workflows/update-docs-config.yml
+++ b/.github/workflows/vitepress-deploy.yml
@@ -1,36 +1,31 @@
-name: Update Docs Config
-
+name: Docs Auto Deploy
on:
push:
branches:
- main
paths:
- 'config/**.json'
+ - 'docs/**'
+ - 'package.json'
jobs:
- update-docs-config:
- name: "Update Docs Config"
+ build:
+ name: Deploy docs
runs-on: ubuntu-latest
if: github.repository == 'crazywhalecc/static-php-cli'
steps:
- - name: "Checkout static-php-cli"
+ - name: Checkout master
uses: actions/checkout@v4
- - name: "Checkout static-php-cli-docs"
- uses: actions/checkout@v4
+ - uses: actions/setup-node@v3
with:
- repository: static-php/static-php-cli-docs
- ref: master
- token: ${{ secrets.DOCS_REPO_TOKEN }}
- path: static-php-cli-docs
+ node-version: 18
+ cache: yarn
- - name: "Set up Git"
- run: |
- git config --global user.email "actions@github.com"
- git config --global user.name "GitHub Actions"
+ - run: yarn install --frozen-lockfile
- name: "Copy Config Files"
- run: cp -r config/* static-php-cli-docs/docs/.vitepress/config/
+ run: cp -r config/* docs/.vitepress/config/
- name: "Install PHP for official runners"
uses: "shivammathur/setup-php@v2"
@@ -58,11 +53,13 @@ jobs:
- name: "Generate Extension Support List"
run: |
- bin/spc dev:gen-ext-docs > static-php-cli-docs/docs/extensions.md
+ bin/spc dev:gen-ext-docs > docs/extensions.md
- - name: "Commit and Push Changes"
- run: |
- cd static-php-cli-docs
- git add -A
- git commit -m "Sync config files from main"
- git push origin master
+ - name: Build
+ run: yarn docs:build
+
+ - name: Deploy to GitHub Pages
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: docs/.vitepress/dist
diff --git a/.gitignore b/.gitignore
index 269a267e..ab857ea9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,11 @@ docker/source/
# default test directory
/tests/var/
+
+# VitePress
+/node_modules/
+/docs/.vitepress/dist/
+/docs/.vitepress/cache/
+package-lock.json
+pnpm-lock.yaml
+yarn.lock
diff --git a/README-zh.md b/README-zh.md
index 8b64a65c..c68d52f8 100755
--- a/README-zh.md
+++ b/README-zh.md
@@ -274,7 +274,7 @@ bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=sys
另外,添加新扩展的贡献方式,可以参考下方 `进阶`。
-如果你想贡献文档内容,请到项目仓库 [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) 贡献。
+如果你想贡献文档内容,请直接修改 `docs/` 目录。
## 赞助本项目
diff --git a/README.md b/README.md
index c61cb7d7..4b000aa8 100755
--- a/README.md
+++ b/README.md
@@ -297,7 +297,7 @@ For an advanced example of how to use this feature, take a look at [how to use i
If the extension you need is missing, you can create an issue.
If you are familiar with this project, you are also welcome to initiate a pull request.
-If you want to contribute documentation, please go to [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs).
+If you want to contribute documentation, please just edit in `docs/`.
Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project.
diff --git a/docs/.vitepress/components/CliGenerator.vue b/docs/.vitepress/components/CliGenerator.vue
new file mode 100644
index 00000000..5ef34495
--- /dev/null
+++ b/docs/.vitepress/components/CliGenerator.vue
@@ -0,0 +1,556 @@
+
+