Skip to content

Commit 095608b

Browse files
author
weilei
committed
fix(ci): 更新部署工作流
1 parent b124cea commit 095608b

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ jobs:
2828
name: 部署文档站
2929
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.deploy_target == 'all' || github.event.inputs.deploy_target == 'docs' }}
3030
runs-on: ubuntu-latest
31-
defaults:
32-
run:
33-
working-directory: docs
3431

3532
steps:
3633
- name: Checkout repository
@@ -47,9 +44,11 @@ jobs:
4744
node-version: '16'
4845

4946
- name: Install dependencies
47+
working-directory: docs
5048
run: npm install
5149

5250
- name: Build documentation
51+
working-directory: docs
5352
run: npm run build
5453

5554
- name: Deploy to Vercel
@@ -58,16 +57,12 @@ jobs:
5857
vercel-token: ${{ secrets.VERCEL_TOKEN }}
5958
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
6059
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_DOCS }}
61-
working-directory: docs
62-
vercel-args: ${{ github.event_name == 'push' && '--prod' || '' }}
60+
vercel-args: ${{ github.event_name == 'push' && '--prod --cwd ./docs' || '--cwd ./docs' }}
6361

6462
deploy-examples:
6563
name: 部署示例项目
6664
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.deploy_target == 'all' || github.event.inputs.deploy_target == 'examples' }}
6765
runs-on: ubuntu-latest
68-
defaults:
69-
run:
70-
working-directory: examples
7166

7267
steps:
7368
- name: Checkout code
@@ -79,9 +74,11 @@ jobs:
7974
node-version: '16'
8075

8176
- name: Install dependencies
77+
working-directory: examples
8278
run: npm install
8379

8480
- name: Build
81+
working-directory: examples
8582
run: npm run build
8683

8784
- name: Deploy to Vercel
@@ -90,5 +87,4 @@ jobs:
9087
vercel-token: ${{ secrets.VERCEL_TOKEN }}
9188
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
9289
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID_EXAMPLES }}
93-
working-directory: examples
94-
vercel-args: '--prod'
90+
vercel-args: '--prod --cwd ./examples'

0 commit comments

Comments
 (0)