File tree Expand file tree Collapse file tree 2 files changed +57
-9
lines changed
Expand file tree Collapse file tree 2 files changed +57
-9
lines changed Original file line number Diff line number Diff line change 11name : Build and Deploy Backend
22
33on :
4- push :
5- branches : [main]
6- paths :
7- - ' shatter-backend/**'
8-
9- pull_request :
10- branches : [main]
11- paths :
12- - ' shatter-backend/**'
4+ # push:
5+ # branches: [main]
6+ # paths:
7+ # - 'shatter-backend/**'
8+
9+ # pull_request:
10+ # branches: [main]
11+ # paths:
12+ # - 'shatter-backend/**'
13+ workflow_dispatch :
1314
1415jobs :
1516 build :
Original file line number Diff line number Diff line change 1+ name : CD - Deploy Backend to Vercel
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ build_number :
7+ description : ' CI Build Number to Deploy'
8+ required : true
9+ type : string
10+
11+ jobs :
12+ deploy :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout code
17+ uses : actions/checkout@v4
18+
19+ - name : Download build artifact
20+ uses : actions/download-artifact@v4
21+ with :
22+ name : node-backend-${{ inputs.build_number }}
23+ path : ./artifacts
24+
25+ - name : Extract artifact
26+ run : |
27+ cd artifacts
28+ tar -xzf node-backend-${{ inputs.build_number }}.tar.gz
29+ ls -la output
30+
31+ - name : Setup Node.js
32+ uses : actions/setup-node@v4
33+ with :
34+ node-version : " 20"
35+
36+ - name : Install Vercel CLI
37+ run : npm install -g vercel
38+
39+ - name : Deploy to Vercel
40+ env :
41+ VERCEL_TOKEN : ${{ secrets.VERCEL_TOKEN }}
42+ VERCEL_ORG_ID : ${{ secrets.VERCEL_ORG_ID }}
43+ VERCEL_PROJECT_ID : ${{ secrets.VERCEL_PROJECT_ID }}
44+ run : |
45+ cd artifacts/output
46+ vercel pull --yes --environment=production --token=$VERCEL_TOKEN
47+ vercel deploy --prod --token=$VERCEL_TOKEN > deployment-url.txt
You can’t perform that action at this time.
0 commit comments