Skip to content

Commit df2fa42

Browse files
conico974Nicolas Dorseuil
and
Nicolas Dorseuil
authored
Chores: create server worker (#3265)
Co-authored-by: Nicolas Dorseuil <[email protected]>
1 parent b3a7ad6 commit df2fa42

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

.github/composite/deploy-cloudflare/action.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ runs:
7373
wranglerVersion: '4.10.0'
7474
environment: ${{ inputs.environment }}
7575
command: ${{ inputs.deploy == 'true' && 'deploy' || format('versions upload --tag {0} --message "{1}"', inputs.commitTag, inputs.commitMessage) }} --config ./packages/gitbook-v2/wrangler.jsonc
76+
77+
- name: Temporary deploy server CF worker
78+
uses: cloudflare/[email protected]
79+
with:
80+
apiToken: ${{ inputs.apiToken }}
81+
accountId: ${{ inputs.accountId }}
82+
workingDirectory: ./
83+
wranglerVersion: '4.10.0'
84+
environment: ${{ inputs.environment }}
85+
command: 'deploy --config ./packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc'
86+
7687
- name: Outputs
7788
shell: bash
7889
env:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default {
2+
async fetch() {
3+
return new Response('Hello World', {
4+
headers: {
5+
'Content-Type': 'text/plain',
6+
},
7+
});
8+
},
9+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"main": "default.js",
3+
"name": "gitbook-open-v2-server",
4+
"compatibility_date": "2025-04-14",
5+
"compatibility_flags": [
6+
"nodejs_compat",
7+
"allow_importable_env",
8+
"global_fetch_strictly_public"
9+
],
10+
"observability": {
11+
"enabled": true
12+
},
13+
"vars": {
14+
"NEXT_CACHE_DO_QUEUE_DISABLE_SQLITE": "true"
15+
},
16+
"env": {
17+
"dev": {
18+
"vars": {
19+
"STAGE": "dev"
20+
}
21+
},
22+
"preview": {
23+
"vars": {
24+
"STAGE": "preview"
25+
}
26+
},
27+
"staging": {
28+
"vars": {
29+
"STAGE": "staging"
30+
}
31+
},
32+
"production": {
33+
"vars": {
34+
"STAGE": "production"
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)