-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.73 KB
/
_vercel-preview.yml
File metadata and controls
53 lines (46 loc) · 1.73 KB
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
52
53
name: "Vercel Preview Deployment"
on:
workflow_call:
# No inputs needed at this time
jobs:
deploy-preview:
environment: Preview
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
with:
version: "0.6.3"
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Make Vercel distribution
run: make dist_vercel
- name: Deploy to Vercel
id: deploy-vercel
uses: helmut-hoffer-von-ankershoffen/vercel-deploy@98d3e8c7256df823790c89efed02d898b8116f86
with:
GITHUB_DEPLOYMENT_ENV: Preview
PRODUCTION: false
WORKING_DIRECTORY: dist_vercel
ARCHIVE: true
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
- name: Smoke Test of Vercel Deployment
run: |
response=$(curl -s -m 5 -H "x-vercel-protection-bypass: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}" ${{ steps.deploy-vercel.outputs.PREVIEW_URL }}/api/v2/hello/world)
echo "API Response: $response"
if [[ "$response" == *"Hello, world!"* ]]; then
echo "✅ API response contains 'Hello, world!' as expected"
else
echo "❌ API response does not contain 'Hello, world!'"
exit 1
fi