-
-
Notifications
You must be signed in to change notification settings - Fork 98
79 lines (68 loc) · 2.89 KB
/
Copy pathdeploy-cloudflare.yml
File metadata and controls
79 lines (68 loc) · 2.89 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
# ═══════════════════════════════════════════════════════════════════════════════
# XActions — Deploy Static Frontend to Cloudflare Pages
# Triggers on push to main when dashboard files change
# by nichxbt
# ═══════════════════════════════════════════════════════════════════════════════
name: Deploy Frontend (Cloudflare Pages)
# Requires two repository secrets: CLOUDFLARE_API_TOKEN (Account -> Cloudflare
# Pages -> Edit) and CLOUDFLARE_ACCOUNT_ID. Without them wrangler exits 1 with
# "it's necessary to set a CLOUDFLARE_API_TOKEN environment variable".
on:
push:
branches: [main]
paths:
- 'dashboard/**'
- 'public/**'
- 'site/**'
- 'functions/**'
- 'src/video/**'
- 'src/ask/**'
- 'src/edge/**'
- 'src/mcp/**'
- 'src/scrapers/twitter/http/**'
- 'api/openapi.js'
- 'api/config/**'
- 'packages/x402-mcp/**'
- 'deploy/cloudflare/**'
- 'llms.txt'
- 'llms-full.txt'
- '.github/workflows/deploy-cloudflare.yml'
workflow_dispatch:
concurrency:
group: deploy-cloudflare
cancel-in-progress: true
jobs:
deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.ref == 'refs/heads/main'
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
# dashboard/ alone is not the site: the root page comes from site/, the og
# images, icons, robots.txt and sitemap.xml come from public/, and the two
# llms*.txt files sit at the root. build.sh assembles all of them into
# pages-out/ the way the route table expects, so deploying dashboard/
# directly would serve the app shell at / and drop every public asset.
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
# The Ask page and the hosted MCP server both read /data/ask-index.json
# from the deployed assets, so a doc added without rerunning the generator
# would be invisible to every agent that connects. Regenerating here means
# production is current whether or not the artifact was committed.
- name: Regenerate the docs index
run: npm run ask:index
- name: Assemble pages-out/
run: bash deploy/cloudflare/build.sh
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy pages-out --project-name=xactions --branch=main