Repository navigation
56 lines (50 loc) · 1.86 KB
/
Copy pathdeploy.yml
File metadata and controls
56 lines (50 loc) · 1.86 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
name: Deploy to Cloudflare
# Production deploy: build the shelf and ship it to the `orly` Worker (static assets)
# at https://orly.<account-subdomain>.workers.dev. Runs on every push to main and can
# be kicked manually. Needs CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID secrets — until
# those are set, the job no-ops (green) instead of failing.
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cf-deploy
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check Cloudflare credentials are configured
id: gate
env:
CF_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
if [ -n "$CF_TOKEN" ]; then
echo "ready=true" >> "$GITHUB_OUTPUT"
else
echo "ready=false" >> "$GITHUB_OUTPUT"
echo "::notice::CLOUDFLARE_API_TOKEN not set — skipping the Cloudflare deploy."
fi
- if: steps.gate.outputs.ready == 'true'
uses: actions/checkout@v5
- if: steps.gate.outputs.ready == 'true'
uses: actions/setup-node@v5
with:
node-version: 22
- if: steps.gate.outputs.ready == 'true'
run: npm install --no-audit --no-fund
- if: steps.gate.outputs.ready == 'true'
run: npm run build
# Ship the viz Storybook alongside the shelf: served by the same Worker
# at /storybook/ (Storybook builds are relative-path, so a subpath works).
- if: steps.gate.outputs.ready == 'true'
run: npm run build-storybook -- --output-dir dist/storybook
- if: steps.gate.outputs.ready == 'true'
name: Deploy to Cloudflare Workers
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy