-
-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (49 loc) · 2.05 KB
/
Copy pathdeploy-web.yml
File metadata and controls
52 lines (49 loc) · 2.05 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
name: Deploy Web
# Build the landing page (packages/web) and deploy it to Cloudflare Pages.
# Runs on pushes to main that touch the web package or the shared ui package,
# and can be triggered manually.
on:
push:
branches: [main]
paths:
- 'packages/web/**'
- 'packages/ui/**'
- '.github/workflows/deploy-web.yml'
workflow_dispatch:
concurrency:
group: deploy-web
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
env:
# Typecheck/build don't need the Electron runtime.
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
# Base URL the download buttons point at — the R2 public bucket. Reuse the
# existing R2_PUBLIC_BASE_URL secret (same value the publish workflow uses).
# If it resolves empty, lib/downloads.ts falls back to the default.
VITE_R2_PUBLIC_BASE_URL: ${{ secrets.VITE_R2_PUBLIC_BASE_URL || vars.VITE_R2_PUBLIC_BASE_URL || secrets.R2_PUBLIC_BASE_URL }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build:web
- name: Deploy to Cloudflare Pages
working-directory: packages/web
# Run wrangler via `pnpm dlx` rather than cloudflare/wrangler-action: the
# action installs wrangler with npm, which chokes on this package's
# `workspace:*` dependency. `pnpm dlx` installs wrangler in isolation and
# understands the workspace protocol.
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT || 'oh-my-github-web' }}
run: |
# Create the Pages project on first run; no-op once it exists.
pnpm dlx wrangler@3.90.0 pages project create "$PROJECT" --production-branch=main || true
pnpm dlx wrangler@3.90.0 pages deploy dist --project-name="$PROJECT" --branch=main