File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Build and Deploy to Cloudflare Pages
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
13+ jobs :
14+ build-and-deploy :
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ deployments : write
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : 22
27+ cache : ' npm'
28+
29+ - name : Install dependencies
30+ run : npm ci
31+
32+ - name : Build
33+ run : npm run build
34+
35+ - name : Deploy to Cloudflare Pages
36+ if : github.ref == 'refs/heads/main'
37+ uses : cloudflare/wrangler-action@v3
38+ with :
39+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
40+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
41+ command : pages deploy dist --project-name=diegosaid
Original file line number Diff line number Diff line change 1414 "build" : " tsc -b && vite build" ,
1515 "lint" : " eslint ." ,
1616 "preview" : " vite preview" ,
17- "deploy" : " npm run build && wrangler pages deploy dist --project-name=diegosaid"
17+ "deploy" : " npm run build && wrangler pages deploy dist --project-name=diegosaid" ,
18+ "deploy:prod" : " git push origin main && npm run deploy"
1819 },
1920 "dependencies" : {
2021 "@gsap/react" : " ^2.1.2" ,
You can’t perform that action at this time.
0 commit comments