Skip to content

Commit 6821d7e

Browse files
committed
Update test-deploy workflow configuration
- Refine workflow settings and job configurations
1 parent a70f299 commit 6821d7e

1 file changed

Lines changed: 21 additions & 29 deletions

File tree

.github/workflows/test-deploy.yml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -48,34 +48,30 @@ jobs:
4848
path: server/dist
4949

5050
# -------------------------
51-
# Server: deploy (only after server tests pass, only on main)
51+
# Server: deploy (only after tests, only on main)
5252
# -------------------------
5353
deploy-server:
5454
name: Deploy Server (traceoffapi)
5555
runs-on: ubuntu-latest
56-
needs: test-server
56+
needs: [test-server, test-mobile]
5757
if: github.ref == 'refs/heads/main'
58+
env:
59+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
60+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_API_ID }}
61+
# VERCEL_ORG_ID is optional for Personal accounts; add if you use a Team
62+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
63+
VERCEL_TELEMETRY_DISABLED: "1"
5864
steps:
5965
- uses: actions/checkout@v4
6066
- uses: actions/setup-node@v4
6167
with:
6268
node-version: 20
63-
# Create .vercel/project.json at runtime without committing it
64-
- name: Vercel pull (production)
69+
- name: Pull Vercel project settings (production)
6570
working-directory: server
66-
env:
67-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
68-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_API_ID }}
69-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # optional for Personal accounts
70-
run: npx vercel pull --yes --environment=production
71-
# Deploy using project/env from the pull step
71+
run: npx vercel pull --yes --environment=production --token="$VERCEL_TOKEN"
7272
- name: Deploy to Vercel (prod)
7373
working-directory: server
74-
env:
75-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
76-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_API_ID }}
77-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # optional
78-
run: npx vercel deploy --prod --yes
74+
run: npx vercel deploy --prod --yes --token="$VERCEL_TOKEN"
7975

8076
# -------------------------
8177
# Mobile: test Android build
@@ -116,13 +112,18 @@ jobs:
116112
path: mobile/build/app/outputs/flutter-apk/app-release.apk
117113

118114
# -------------------------
119-
# Web: build & deploy Flutter web (only after mobile tests pass, only on main)
115+
# Web: build & deploy Flutter Web (only after mobile tests, only on main)
120116
# -------------------------
121117
deploy-web:
122118
name: Deploy Flutter Web (traceoff)
123119
runs-on: ubuntu-latest
124-
needs: test-mobile
120+
needs: [test-server, test-mobile]
125121
if: github.ref == 'refs/heads/main'
122+
env:
123+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
124+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_WEB_ID }}
125+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
126+
VERCEL_TELEMETRY_DISABLED: "1"
126127
steps:
127128
- uses: actions/checkout@v4
128129
- uses: subosito/flutter-action@v2
@@ -138,18 +139,9 @@ jobs:
138139
- uses: actions/setup-node@v4
139140
with:
140141
node-version: 20
141-
# Link project for this directory (we deploy from build output dir)
142-
- name: Vercel pull (production)
142+
- name: Pull Vercel project settings (production)
143143
working-directory: mobile/build/web
144-
env:
145-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
146-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_WEB_ID }}
147-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # optional
148-
run: npx vercel pull --yes --environment=production
144+
run: npx vercel pull --yes --environment=production --token="$VERCEL_TOKEN"
149145
- name: Deploy to Vercel (prod)
150146
working-directory: mobile/build/web
151-
env:
152-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
153-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_WEB_ID }}
154-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} # optional
155-
run: npx vercel deploy --prod --yes
147+
run: npx vercel deploy --prod --yes --token="$VERCEL_TOKEN"

0 commit comments

Comments
 (0)