File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ name: Vercel Preview Deployment
2
2
env :
3
3
VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
4
4
VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
5
+
5
6
on :
6
7
push :
7
8
branches-ignore :
8
9
- main
10
+
9
11
jobs :
10
12
Deploy-Preview :
11
13
runs-on : ubuntu-20.04
14
+ environment :
15
+ name : preview
12
16
steps :
13
17
- uses : actions/checkout@v4
14
18
- name : Install Vercel CLI
18
22
- name : Build Project Artifacts
19
23
run : vercel build --token=${{ secrets.VERCEL_TOKEN }}
20
24
- name : Deploy Project Artifacts to Vercel
21
- run : vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
25
+ run : |
26
+ vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > deployment.txt
27
+ id : deploy
28
+ - name : Extract Deployment URL
29
+ run : |
30
+ DEPLOYMENT_URL=$(tail -n 1 deployment.txt)
31
+ echo "DEPLOYMENT_URL=$DEPLOYMENT_URL" >> $GITHUB_ENV
32
+ id : extract-url
33
+ - name : Set Environment URL
34
+ if : success()
35
+ environment :
36
+ name : preview
37
+ url : ${{ env.DEPLOYMENT_URL }}
You can’t perform that action at this time.
0 commit comments