Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions .github/workflows/vitepress-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
name: Docs Auto Deploy
name: Docs build test and auto deploy
on:
pull_request:
branches: [ "v3" ]
types: [ opened, synchronize, reopened ]
paths:
- 'config/**.yml'
- 'docs/**'
- 'package.json'
- 'yarn.lock'
- '.github/workflows/vitepress-deploy.yml'
push:
branches:
- v3
branches: [ "v3" ]
paths:
- 'config/**.yml'
- 'docs/**'
Expand All @@ -20,15 +28,8 @@ jobs:
uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
cache: yarn

- run: yarn install --frozen-lockfile

- name: "Copy Config Files"
run: |
mkdir -p docs/.vitepress/config
cp -r config/* docs/.vitepress/config/
- run: npm install

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

# TODO: Uncomment when v3 gen commands are implemented
# - name: "Generate Extension Support List"
# run: |
# bin/spc dev:gen-ext-docs > docs/en/guide/extensions.md
# bin/spc dev:gen-ext-docs > docs/zh/guide/extensions.md
# bin/spc dev:gen-ext-dep-docs > docs/en/guide/deps-map.md
# bin/spc dev:gen-ext-dep-docs > docs/zh/guide/deps-map.md

- name: Build
run: yarn docs:build
run: npm run docs:build

# Deploy to GitHub Pages only when the workflow is triggered by a push to the v3 branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' && github.ref == 'refs/heads/v3'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"scripts": {
"docs:dev": "vitepress dev docs",
"docs:dev": "node docs/.vitepress/gen-meta.js && vitepress dev docs",
"docs:gen-meta": "node docs/.vitepress/gen-meta.js",
"docs:build": "npm run docs:gen-meta && vitepress build docs",
"docs:preview": "vitepress preview docs"
Expand Down
Loading