Skip to content

Commit 8d0abac

Browse files
authored
Update Vercel deployment workflow in GitHub Actions
1 parent de5e94e commit 8d0abac

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/build-push-next.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,30 @@ jobs:
3535
- name: Update engine to next version
3636
run: npm install eecircuit-engine@next
3737

38-
- name: Build Project with Vite
39-
run: npm run build
38+
- name: Pull Vercel env
39+
env:
40+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
41+
run: npx vercel pull --yes --token "$VERCEL_TOKEN"
42+
43+
- name: Build Local for Vercel
44+
env:
45+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
46+
run: npx vercel build --prod --token "$VERCEL_TOKEN"
4047

4148
- name: Deploy to Vercel
42-
run: npx vercel --token=${{ secrets.VERCEL_TOKEN }}
49+
id: deploy
50+
env:
51+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
52+
run: |
53+
set -euo pipefail
54+
url=$(npx vercel deploy --prebuilt --prod --token "$VERCEL_TOKEN")
55+
echo "url=$url" >> "$GITHUB_OUTPUT"
56+
57+
- name: Alias deployment
58+
if: ${{ steps.deploy.outputs.url != '' }}
59+
env:
60+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
61+
run: npx vercel alias "${{ steps.deploy.outputs.url }}" next.eecircuit.com --token "$VERCEL_TOKEN"
4362

4463
- name: Install Playwright Browsers
4564
run: npx playwright install --with-deps

0 commit comments

Comments
 (0)