Chores: create server worker (#3265)

Co-authored-by: Nicolas Dorseuil <nicolas@gitbook.io>
This commit is contained in:
conico974
2025-05-30 14:31:21 +02:00
committed by GitHub
parent b3a7ad6d2c
commit df2fa42bda
3 changed files with 58 additions and 0 deletions
@@ -73,6 +73,17 @@ runs:
wranglerVersion: '4.10.0'
environment: ${{ inputs.environment }}
command: ${{ inputs.deploy == 'true' && 'deploy' || format('versions upload --tag {0} --message "{1}"', inputs.commitTag, inputs.commitMessage) }} --config ./packages/gitbook-v2/wrangler.jsonc
- name: Temporary deploy server CF worker
uses: cloudflare/wrangler-action@v3.14.0
with:
apiToken: ${{ inputs.apiToken }}
accountId: ${{ inputs.accountId }}
workingDirectory: ./
wranglerVersion: '4.10.0'
environment: ${{ inputs.environment }}
command: 'deploy --config ./packages/gitbook-v2/openNext/customWorkers/defaultWrangler.jsonc'
- name: Outputs
shell: bash
env:
@@ -0,0 +1,9 @@
export default {
async fetch() {
return new Response('Hello World', {
headers: {
'Content-Type': 'text/plain',
},
});
},
};
@@ -0,0 +1,38 @@
{
"main": "default.js",
"name": "gitbook-open-v2-server",
"compatibility_date": "2025-04-14",
"compatibility_flags": [
"nodejs_compat",
"allow_importable_env",
"global_fetch_strictly_public"
],
"observability": {
"enabled": true
},
"vars": {
"NEXT_CACHE_DO_QUEUE_DISABLE_SQLITE": "true"
},
"env": {
"dev": {
"vars": {
"STAGE": "dev"
}
},
"preview": {
"vars": {
"STAGE": "preview"
}
},
"staging": {
"vars": {
"STAGE": "staging"
}
},
"production": {
"vars": {
"STAGE": "production"
}
}
}
}