Skip to content

Commit 3fbaada

Browse files
authored
Merge branch 'qiniu:develop' into develop
2 parents b9c532c + ee48c71 commit 3fbaada

File tree

14 files changed

+4291
-5772
lines changed

14 files changed

+4291
-5772
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Frontend to Vercel
2+
3+
on:
4+
pull_request_target:
5+
branches: [develop]
6+
paths: ['client/**']
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'yarn'
26+
cache-dependency-path: client/yarn.lock
27+
28+
- name: Install dependencies
29+
run: |
30+
cd client
31+
yarn install --frozen-lockfile
32+
33+
- name: Build project
34+
run: |
35+
cd client
36+
yarn build
37+
38+
- name: Deploy to Vercel
39+
id: vercel-deploy
40+
uses: amondnet/vercel-action@v25
41+
with:
42+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
43+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
44+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
45+
working-directory: ./client
46+
scope: ${{ secrets.VERCEL_ORG_ID }}
47+
48+
- name: Comment PR
49+
if: github.event_name == 'pull_request_target'
50+
uses: actions/github-script@v7
51+
with:
52+
script: |
53+
const deployUrl = '${{ steps.vercel-deploy.outputs.preview-url }}';
54+
github.rest.issues.createComment({
55+
issue_number: context.issue.number,
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
body: `🚀 **Frontend deployed successfully!**\n\n📱 **Preview URL:** ${deployUrl || 'Deployment in progress...'}\n\n✅ Build completed successfully`
59+
});

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@ __debug_bin
313313
.dockerignore
314314

315315
CLAUDE.md
316+
.vercel

client/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ See [Vite Configuration Reference](https://vite.dev/config/).
1717
## Project Setup
1818

1919
```sh
20-
npm install
20+
yarn install
2121
```
2222

2323
### Compile and Hot-Reload for Development
2424

2525
```sh
26-
npm run dev
26+
yarn dev
2727
```
2828

2929
### Type-Check, Compile and Minify for Production
3030

3131
```sh
32-
npm run build
32+
yarn build
3333
```
3434

3535
### Lint with [ESLint](https://eslint.org/)
3636

3737
```sh
38-
npm run lint
38+
yarn lint
3939
```

0 commit comments

Comments
 (0)