Repository navigation
65 lines (57 loc) · 2.12 KB
/
Copy pathdeploy.yml
File metadata and controls
65 lines (57 loc) · 2.12 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
name: deploy
on:
push:
branches:
- dev
# Manual rebuild via the Actions tab "Run workflow" button, and the trigger
# used by netclaw-dev/netclaw's release workflow to refresh /changelog.
workflow_dispatch:
jobs:
deploy:
name: "Deploy to Cloudflare Pages"
# Pinned: the Playwright version in package-lock.json has no Chromium build for ubuntu-latest (26.04).
runs-on: ubuntu-24.04
environment:
name: production
url: https://netclaw.dev
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Cache Playwright browser
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
# Mermaid diagrams render at build time through a headless browser. Without it
# the build still succeeds but pages with diagrams ship with an empty body
# (scripts/check-rendered-pages.mjs fails the build when that happens).
# The browser revision follows the playwright version pinned in package-lock.json.
- name: Install Playwright browser
run: |
if [ "${{ steps.playwright-cache.outputs.cache-hit }}" = "true" ]; then
npx playwright install-deps chromium-headless-shell
else
npx playwright install --with-deps chromium-headless-shell
fi
- name: Build site
run: npm run build
env:
HCTI_USER_ID: ${{ secrets.HCTI_USER_ID }}
HCTI_API_KEY: ${{ secrets.HCTI_API_KEY }}
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3.15.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy dist --project-name=netclaw-website