File tree Expand file tree Collapse file tree 4 files changed +84
-5
lines changed Expand file tree Collapse file tree 4 files changed +84
-5
lines changed Original file line number Diff line number Diff line change 1+ name : Vercel Preview Deployment
2+
3+ env :
4+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
5+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
6+
7+ on :
8+ pull_request :
9+ branches : [ "master" ]
10+ workflow_dispatch :
11+
12+ concurrency :
13+ group : " vercel-preview-${{ github.event.pull_request.number }}"
14+ cancel-in-progress : true
15+
16+ jobs :
17+ test :
18+ uses : ./.github/workflows/tests.yml
19+
20+ deploy-preview :
21+ needs : [test]
22+ runs-on : ubuntu-latest
23+ # Do not run for PR from forks
24+ if : github.event.pull_request.head.repo.full_name == github.repository
25+
26+ steps :
27+ - name : Checkout code
28+ uses : actions/checkout@v4
29+
30+ - name : Install Vercel CLI
31+ run :
npm install --global [email protected] 32+
33+ - name : Pull Vercel Environment Information
34+ run : vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
35+
36+ - name : Build Project Artifacts
37+ run : vercel build --token=${{ secrets.VERCEL_TOKEN }}
38+
39+ - name : Deploy Project Artifacts to Vercel
40+ run : vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
Original file line number Diff line number Diff line change 1+ name : Vercel Production Deployment
2+
3+ env :
4+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
5+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
6+
7+ on :
8+ push :
9+ branches : [ "master" ]
10+ workflow_dispatch :
11+
12+ concurrency :
13+ group : " vercel-production-${{ github.ref }}"
14+ cancel-in-progress : false # waits for the previous one to finish
15+
16+ jobs :
17+ test :
18+ uses : ./.github/workflows/tests.yml
19+
20+ deploy-production :
21+ needs : [test]
22+ runs-on : ubuntu-latest
23+
24+ steps :
25+ - name : Checkout code
26+ uses : actions/checkout@v4
27+
28+ - name : Install Vercel CLI
29+ run :
npm install --global [email protected] 30+
31+ - name : Pull Vercel Environment Information
32+ run : vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
33+
34+ - name : Build Project Artifacts
35+ run : vercel build --token=${{ secrets.VERCEL_TOKEN }}
36+
37+ - name : Deploy Project Artifacts to Vercel
38+ run : vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
Original file line number Diff line number Diff line change 11name : Tests
22
33on :
4- push :
5- branches : [ "master" ]
6- pull_request :
7- branches : [ "master" ]
4+ workflow_call :
85 workflow_dispatch :
96
107jobs :
Original file line number Diff line number Diff line change 44 "src" : " /(.*)" ,
55 "dest" : " /api/vercel_function"
66 }
7- ]
7+ ],
8+
9+ "git" : {
10+ "deploymentEnabled" : false
11+ }
812}
You can’t perform that action at this time.
0 commit comments