File tree Expand file tree Collapse file tree 2 files changed +48
-3
lines changed
Expand file tree Collapse file tree 2 files changed +48
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Frontend to Cloudflare Pages
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ paths :
7+ - ' client-test/**'
8+ - ' .github/workflows/deploy-frontend.yml'
9+
10+ jobs :
11+ deploy :
12+ runs-on : ubuntu-latest
13+ name : Deploy to Cloudflare Pages
14+
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+
19+ - name : Setup Node.js
20+ uses : actions/setup-node@v4
21+ with :
22+ node-version : ' 18'
23+ cache : ' npm'
24+ cache-dependency-path : ' client-test/package-lock.json'
25+
26+ - name : Install dependencies
27+ run : |
28+ cd client-test
29+ npm ci
30+
31+ - name : Build application
32+ run : |
33+ cd client-test
34+ npm run build
35+ env :
36+ VITE_API_BASE_URL : ${{ secrets.VITE_API_BASE_URL }}
37+
38+ - name : Deploy to Cloudflare Pages
39+ uses : cloudflare/pages-action@v1
40+ with :
41+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
42+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
43+ projectName : codequest-frontend
44+ directory : client-test/dist
45+ gitHubToken : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ dotenv.config();
77
88connectDB ( ) ;
99
10- // const PORT = process.env.PORT || 5000
11- // app.listen(PORT, () => { console.log(`Server is running at ${PORT}`); })
10+ const PORT = process . env . PORT || 5000
11+ app . listen ( PORT , ( ) => { console . log ( `Server is running at ${ PORT } ` ) ; } )
1212
13- export const handler = serverless ( app ) ;
13+ // export const handler = serverless(app);
You can’t perform that action at this time.
0 commit comments