11name : ' Deploy cloudflare'
22description : ' Deploy GitBook to Cloudflare'
33inputs :
4+ opItem :
5+ description : ' 1Password item to load secrets from'
6+ required : true
7+ opServiceAccount :
8+ description : ' 1Password service account token'
9+ required : true
410 apiToken :
511 description : ' Cloudflare API token'
612 required : true
713 accountId :
814 description : ' Cloudflare account ID'
915 required : true
1016 environment :
11- description : ' Environment to deploy to'
17+ description : ' Cloudflare environment to deploy to (staging, production, preview) '
1218 required : true
1319 deploy :
1420 description : ' Deploy as main version for all traffic instead of uploading versions'
1521 required : true
16- NEXT_SERVER_ACTIONS_ENCRYPTION_KEY :
17- description : ' Next server actions encryption key'
18- required : true
19- GITBOOK_URL :
20- description : ' GitBook URL'
21- required : true
22- GITBOOK_SECRET :
23- description : ' GitBook secret'
24- required : true
25- GITBOOK_APP_URL :
26- description : ' GitBook app URL'
27- required : false
28- GITBOOK_API_URL :
29- description : ' GitBook API URL'
30- required : false
31- GITBOOK_INTEGRATIONS_HOST :
32- description : ' GitBook integrations host'
33- required : false
34- GITBOOK_IMAGE_RESIZE_SIGNING_KEY :
35- description : ' GitBook image resize signing key'
36- required : true
37- GITBOOK_IMAGE_RESIZE_URL :
38- description : ' GitBook image resize URL'
39- required : true
40- GITBOOK_ICONS_URL :
41- description : ' GitBook icons URL'
42- required : true
43- GITBOOK_ICONS_TOKEN :
44- description : ' GitBook icons token'
45- required : true
46- GITBOOK_ASSETS_PREFIX :
47- description : ' GitBook assets prefix'
48- required : false
4922outputs :
5023 deployment-url :
5124 description : " Deployment URL"
@@ -60,21 +33,25 @@ runs:
6033 shell : bash
6134 env :
6235 PUPPETEER_SKIP_DOWNLOAD : 1
36+ - name : Load secret
37+ uses : 1password/load-secrets-action@v2
38+ env :
39+ OP_SERVICE_ACCOUNT_TOKEN : ${{ inputs.opServiceAccount }}
40+ GITBOOK_URL : ${{ inputs.opItem }}/GITBOOK_URL
41+ GITBOOK_ICONS_URL : ${{ inputs.opItem }}/GITBOOK_ICONS_URL
42+ GITBOOK_ICONS_TOKEN : ${{ inputs.opItem }}/GITBOOK_ICONS_TOKEN
43+ NEXT_SERVER_ACTIONS_ENCRYPTION_KEY : ${{ inputs.opItem }}/NEXT_SERVER_ACTIONS_ENCRYPTION_KEY
44+ GITBOOK_SECRET : ${{ inputs.opItem }}/GITBOOK_SECRET
45+ GITBOOK_APP_URL : ${{ inputs.opItem }}/GITBOOK_APP_URL
46+ GITBOOK_API_URL : ${{ inputs.opItem }}/GITBOOK_API_URL
47+ GITBOOK_API_TOKEN : ${{ inputs.opItem }}/GITBOOK_API_TOKEN
48+ GITBOOK_INTEGRATIONS_HOST : ${{ inputs.opItem }}/GITBOOK_INTEGRATIONS_HOST
49+ GITBOOK_IMAGE_RESIZE_SIGNING_KEY : ${{ inputs.opItem }}/GITBOOK_IMAGE_RESIZE_SIGNING_KEY
50+ GITBOOK_IMAGE_RESIZE_URL : ${{ inputs.opItem }}/GITBOOK_IMAGE_RESIZE_URL
51+ GITBOOK_ASSETS_PREFIX : ${{ inputs.opItem }}/GITBOOK_ASSETS_PREFIX
6352 - name : Build worker
6453 run : bun run turbo build:v2:cloudflare
6554 shell : bash
66- env :
67- NEXT_SERVER_ACTIONS_ENCRYPTION_KEY : ${{ inputs.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY }}
68- GITBOOK_URL : ${{ inputs.GITBOOK_URL }}
69- GITBOOK_SECRET : ${{ inputs.GITBOOK_SECRET }}
70- GITBOOK_APP_URL : ${{ inputs.GITBOOK_APP_URL }}
71- GITBOOK_API_URL : ${{ inputs.GITBOOK_API_URL }}
72- GITBOOK_INTEGRATIONS_HOST : ${{ inputs.GITBOOK_INTEGRATIONS_HOST }}
73- GITBOOK_IMAGE_RESIZE_SIGNING_KEY : ${{ inputs.GITBOOK_IMAGE_RESIZE_SIGNING_KEY }}
74- GITBOOK_IMAGE_RESIZE_URL : ${{ inputs.GITBOOK_IMAGE_RESIZE_URL }}
75- GITBOOK_ICONS_URL : ${{ inputs.GITBOOK_ICONS_URL }}
76- GITBOOK_ICONS_TOKEN : ${{ inputs.GITBOOK_ICONS_TOKEN }}
77- GITBOOK_ASSETS_PREFIX : ${{ inputs.GITBOOK_ASSETS_PREFIX }}
7855 - id : deploy
7956 name : Deploy to Cloudflare
8057 uses :
cloudflare/[email protected] 8461 workingDirectory : ./
8562 wranglerVersion : ' 3.112.0'
8663 environment : ${{ inputs.environment }}
87- command : ${{ inputs.deploy && 'deploy' || 'versions upload' }} --config ./packages/gitbook-v2/wrangler.toml
64+ command : ${{ fromJSON( inputs.deploy) == true && 'deploy' || 'versions upload' }} --config ./packages/gitbook-v2/wrangler.toml
8865 - name : Outputs
8966 shell : bash
9067 env :
0 commit comments