-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 2.22 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Deploy Cloudflare Workers
on:
push:
branches:
- main
repository_dispatch:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate wrangler.toml
run: |
cat << EOF > wrangler.toml
name = "${{ secrets.CLOUDFLARE_WORKER_NAME }}"
type = "javascript"
main = "cf-worker-summary.js"
compatibility_date = "2024-10-22"
workers_dev = false
routes = [{ pattern = "${{ secrets.SUMMARY_API }}/summary*", zone_id = "${{ secrets.CLOUDFLARE_ZONE_ID }}" }]
[vars]
JINA_READER_URL = "${{ secrets.JINA_READER_URL }}"
AI_PROVIDER = "${{ secrets.AI_PROVIDER }}"
AI_MODEL = "${{ secrets.AI_MODEL }}"
AI_API_KEY = "${{ secrets.AI_API_KEY }}"
AI_ENDPOINT = "${{ secrets.AI_ENDPOINT }}"
ALLOWED_DOMAINS = "${{ secrets.ALLOWED_DOMAINS }}"
CACHE_TTL = "${{ secrets.CACHE_TTL }}"
RATE_LIMIT = "${{ secrets.RATE_LIMIT }}"
MAX_CONTENT_LENGTH = "${{ secrets.MAX_CONTENT_LENGTH }}"
SUMMARY_MIN_LENGTH = "${{ secrets.SUMMARY_MIN_LENGTH }}"
PART_SIZE = "${{ secrets.PART_SIZE }}"
OVERLAP_SIZE = "${{ secrets.OVERLAP_SIZE }}"
LANGUAGE_DETECTOR_URL = "${{ secrets.LANGUAGE_DETECTOR_URL }}"
#PROMPT_TEMPLATE = "${{ secrets.PROMPT_TEMPLATE }}"
#PART_SUMMARY_PROMPT = "${{ secrets.PART_SUMMARY_PROMPT }}"
#COMBINE_SUMMARIES_PROMPT = "${{ secrets.COMBINE_SUMMARIES_PROMPT }}"
#TRANSLATION_PROMPT = "${{ secrets.TRANSLATION_PROMPT }}"
[[kv_namespaces]]
binding = "KV"
id = "${{ secrets.KV_NAMESPACE_ID }}"
[[d1_databases]]
binding = "DB"
database_name = "${{ secrets.D1_DATABASE_NAME }}"
database_id = "${{ secrets.D1_DATABASE_ID }}"
[ai]
binding = "AI"
[observability]
enabled = true
head_sampling_rate = 1
[placement]
mode = "smart"
EOF
- name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
command: deploy --var VERSION:${{ github.sha }}