-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.66 KB
/
webPreview.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Vercel deployment - Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
on:
push:
branches-ignore:
- master
jobs:
Build-Web:
name: Build web version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Install dependencies
run: flutter pub get
- name: Build web version
run: flutter build web
- name: Compact the build result
run: tar -czf web-build.tar.gz build/web
- name: Upload the build result to artifacts
uses: actions/upload-artifact@v3
with:
name: web-build
path: web-build.tar.gz
Deploy-Preview:
name: Deploy preview to Vercel
needs: Build-Web
environment:
name: Vercel - Preview
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download the build result from artifacts
uses: actions/[email protected]
with:
name: web-build
- name: Get the build result file content
run: tar -xzf web-build.tar.gz
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel environment information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} ./build/web
- name: Build project artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} --cwd ./build/web
- name: Deploy project artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} ./build/web