Skip to content

Commit a4a0ad5

Browse files
committed
fix: 修复GitHub Actions部署配置问题
- 移除重复的Vercel配置参数 - 修正Slack通知配置 - 添加构建输出检查步骤 - 提高部署过程的错误处理能力
1 parent d12606b commit a4a0ad5

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,29 @@ jobs:
3434
env:
3535
NODE_ENV: production
3636

37+
- name: Check if build output exists
38+
run: |
39+
if [ ! -d "dist-example" ]; then
40+
echo "Build output directory does not exist"
41+
exit 1
42+
fi
43+
if [ ! -f "dist-example/index.html" ]; then
44+
echo "index.html not found in build output"
45+
exit 1
46+
fi
47+
3748
- name: List build output
3849
run: ls -la dist-example/
3950

4051
- name: Deploy to Vercel
52+
id: deploy
4153
uses: amondnet/vercel-action@v25
4254
with:
4355
vercel-token: ${{ secrets.VERCEL_TOKEN }}
4456
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
4557
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
4658
working-directory: ./
4759
vercel-args: '--prod'
48-
vercel-org: ${{ secrets.VERCEL_ORG_ID }}
49-
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
5060
scope: ${{ secrets.VERCEL_ORG_ID }}
5161

5262
- name: Notify deployment status
@@ -55,6 +65,4 @@ jobs:
5565
with:
5666
status: ${{ job.status }}
5767
text: 'Deployment to production ${{ job.status }}'
58-
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
59-
env:
60-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
68+
webhook_url: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)