1- name : Docs Auto Deploy
1+ name : Docs build test and auto deploy
22on :
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/**'
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
0 commit comments