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 : Production
2+
3+ # Deploys the site to PRODUCTION. `wrangler deploy` promotes the new version to
4+ # 100% live traffic. Runs on merge to main, or manually via the Actions tab. PR
5+ # builds use preview.yaml (`versions upload`) and never reach production.
6+ on :
7+ push :
8+ branches :
9+ - main
10+ workflow_dispatch :
11+
12+ # Never run two production deploys at once; do not cancel an in-flight deploy.
13+ concurrency :
14+ group : deploy-production
15+ cancel-in-progress : false
16+
17+ jobs :
18+ deploy :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : 20.x
27+
28+ - name : Install dependencies
29+ run : npm ci
30+
31+ - name : Build the site
32+ run : npm run build:worker
33+
34+ - name : Deploy to production
35+ id : deploy
36+ uses : cloudflare/wrangler-action@v3.14.1
37+ with :
38+ apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
39+ accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
40+ command : deploy --minify
41+
42+ - name : Print website URL
43+ env :
44+ DEPLOYMENT_URL : ${{ steps.deploy.outputs.deployment-url }}
45+ run : echo $DEPLOYMENT_URL
You can’t perform that action at this time.
0 commit comments