Skip to content

Commit 6154d32

Browse files
committed
chore: deploy Flutter web to Vercel via GitHub Actions
1 parent 9e18b11 commit 6154d32

2 files changed

Lines changed: 35 additions & 3 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Flutter
15+
uses: subosito/flutter-action@v2
16+
with:
17+
flutter-version: '3.29.3'
18+
channel: 'stable'
19+
cache: true
20+
21+
- name: Install dependencies
22+
run: flutter pub get
23+
24+
- name: Build Flutter Web
25+
run: flutter build web --release
26+
27+
- name: Install Vercel CLI
28+
run: npm install -g vercel
29+
30+
- name: Deploy to Vercel
31+
run: vercel deploy build/web --token=${{ secrets.VERCEL_TOKEN }} --prod --yes
32+
env:
33+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
34+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

vercel.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"buildCommand": "flutter build web --release",
32
"outputDirectory": "build/web",
4-
"installCommand": "if ! command -v flutter &> /dev/null; then git clone https://github.com/flutter/flutter.git -b stable --depth 1 ~/flutter && export PATH=$PATH:~/flutter/bin && flutter doctor; fi",
53
"framework": null
6-
}
4+
}

0 commit comments

Comments
 (0)