File tree Expand file tree Collapse file tree 2 files changed +48
-9
lines changed Expand file tree Collapse file tree 2 files changed +48
-9
lines changed Original file line number Diff line number Diff line change 1- on : [push, workflow_dispatch]
1+ on :
2+ pull_request :
3+ branches :
4+ - production
25
36concurrency :
47 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5- cancel-in-progress : ${{ !contains(github.ref, 'production')}}
8+ cancel-in-progress : true
69
710jobs :
811 publish :
912 runs-on : ubuntu-22.04
1013 permissions :
1114 contents : read
12- name : Publish to Cloudflare Pages
15+ name : Publish to Cloudflare Pages (Preview)
1316 steps :
1417 - uses : actions/checkout@v4
1518 - uses : actions/setup-node@v4
3134 env :
3235 CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3336 CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
34- - run : npm run build:worker && npx wrangler deploy -c ./wrangler-workers.toml
35- if : github.ref == 'refs/heads/production'
36- name : Deploy to Cloudflare Workers [production]
37- env :
38- CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
3937 - run : npm run build:worker && npx wrangler versions upload -c ./wrangler-workers.toml
40- if : github.ref != 'refs/heads/production'
4138 name : Deploy to Cloudflare Workers [preview]
4239 env :
4340 CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
Original file line number Diff line number Diff line change 1+ on :
2+ pull_request :
3+ branches :
4+ - production
5+ types :
6+ - closed
7+
8+ jobs :
9+ publish :
10+ if : github.event.pull_request.merged == true
11+ runs-on : ubuntu-22.04
12+ permissions :
13+ contents : read
14+ name : Publish to Cloudflare Pages (Production)
15+ steps :
16+ - uses : actions/checkout@v4
17+ - uses : actions/setup-node@v4
18+ with :
19+ node-version : 22.x
20+ cache : npm
21+ - run : npm ci
22+ - uses : actions/cache/restore@v4
23+ with :
24+ path : |
25+ node_modules/.astro/_astro
26+ node_modules/.astro/assets
27+ key : static
28+ - run : npx astro build
29+ env :
30+ NODE_OPTIONS : --max-old-space-size=4096
31+ - run : npx wrangler pages deploy --project-name cloudflare-docs dist
32+ name : Deploy to Cloudflare Pages
33+ env :
34+ CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
35+ CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
36+ - uses : actions/cache/save@v4
37+ if : always()
38+ with :
39+ path : |
40+ node_modules/.astro/_astro
41+ node_modules/.astro/assets
42+ key : static
You can’t perform that action at this time.
0 commit comments