Skip to content

Commit b92a06a

Browse files
committed
Update deployment workflow and enhance documentation build process
1 parent 88d2f0f commit b92a06a

2 files changed

Lines changed: 16 additions & 21 deletions

File tree

.github/workflows/vitepress-deploy.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1-
name: Docs Auto Deploy
1+
name: Docs build test and auto deploy
22
on:
3+
pull_request:
4+
branches: [ "v3" ]
5+
types: [ opened, synchronize, reopened ]
6+
paths:
7+
- 'config/**.yml'
8+
- 'docs/**'
9+
- 'package.json'
10+
- 'yarn.lock'
11+
- '.github/workflows/vitepress-deploy.yml'
312
push:
4-
branches:
5-
- v3
13+
branches: [ "v3" ]
614
paths:
715
- 'config/**.yml'
816
- 'docs/**'
@@ -20,15 +28,8 @@ jobs:
2028
uses: actions/checkout@v4
2129

2230
- uses: actions/setup-node@v3
23-
with:
24-
cache: yarn
2531

26-
- run: yarn install --frozen-lockfile
27-
28-
- name: "Copy Config Files"
29-
run: |
30-
mkdir -p docs/.vitepress/config
31-
cp -r config/* docs/.vitepress/config/
32+
- run: npm install
3233

3334
- name: "Install PHP for official runners"
3435
uses: shivammathur/setup-php@v2
@@ -55,19 +56,13 @@ jobs:
5556
- name: "Install Locked Dependencies"
5657
run: "composer install --no-interaction --no-progress"
5758

58-
# TODO: Uncomment when v3 gen commands are implemented
59-
# - name: "Generate Extension Support List"
60-
# run: |
61-
# bin/spc dev:gen-ext-docs > docs/en/guide/extensions.md
62-
# bin/spc dev:gen-ext-docs > docs/zh/guide/extensions.md
63-
# bin/spc dev:gen-ext-dep-docs > docs/en/guide/deps-map.md
64-
# bin/spc dev:gen-ext-dep-docs > docs/zh/guide/deps-map.md
65-
6659
- name: Build
67-
run: yarn docs:build
60+
run: npm run docs:build
6861

62+
# Deploy to GitHub Pages only when the workflow is triggered by a push to the v3 branch
6963
- name: Deploy to GitHub Pages
7064
uses: peaceiris/actions-gh-pages@v3
65+
if: github.event_name == 'push' && github.ref == 'refs/heads/v3'
7166
with:
7267
github_token: ${{ secrets.GITHUB_TOKEN }}
7368
publish_dir: docs/.vitepress/dist

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"scripts": {
3-
"docs:dev": "vitepress dev docs",
3+
"docs:dev": "node docs/.vitepress/gen-meta.js && vitepress dev docs",
44
"docs:gen-meta": "node docs/.vitepress/gen-meta.js",
55
"docs:build": "npm run docs:gen-meta && vitepress build docs",
66
"docs:preview": "vitepress preview docs"

0 commit comments

Comments
 (0)