-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.16 KB
/
_deploy.yml
File metadata and controls
39 lines (34 loc) · 1.16 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
name: _Deploy Host Capabilities
on:
workflow_call:
secrets:
CLOUDFLARE_API_TOKEN:
required: true
CLOUDFLARE_ACCOUNT_ID:
required: true
jobs:
deploy:
name: Cloudflare Pages
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# Unlike std (bare .wasm artifacts), the host serves its ESM sources, so checkout the tree.
- uses: actions/checkout@v6
# Flatten each capability's src/ into _site/<cap> so the public path is <cap>/index.js; siblings move together, so relative imports stay valid.
- name: Assemble site
run: |
mkdir -p _site
for dir in */src; do
cap="${dir%/src}"
mkdir -p "_site/$cap"
cp -r "$dir"/. "_site/$cap/"
done
# Pages serves the modules at host.edgepython.com/<cap>/*.
- name: Deploy
uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Pin to the Pages production branch.
command: pages deploy _site --project-name=edge-python-host --branch=main