-
-
Notifications
You must be signed in to change notification settings - Fork 109
129 lines (112 loc) · 3.64 KB
/
Copy pathweb-deploy.yml
File metadata and controls
129 lines (112 loc) · 3.64 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Deploy static sites
on:
push:
branches: [develop]
paths:
- 'web/**'
- '.github/workflows/web-deploy.yml'
pull_request:
branches: [develop]
paths:
- 'web/**'
- '.github/workflows/web-deploy.yml'
jobs:
deploy:
name: Deploy ${{ matrix.site }}
runs-on: ubuntu-latest
concurrency:
group: web-deploy-${{ matrix.site }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
deployments: write
pull-requests: write
strategy:
fail-fast: false
matrix:
site: [landing, blog, guides, api]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.23.0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Install dependencies
working-directory: web
run: pnpm install --frozen-lockfile
- name: Build ${{ matrix.site }}
working-directory: web
run: pnpm --filter @wheels-dev/site-${{ matrix.site }} build
- name: Deploy to Cloudflare Pages
working-directory: web
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Routed via env to keep untrusted branch names out of the command string.
DEPLOY_BRANCH: ${{ github.head_ref || github.ref_name }}
SITE: ${{ matrix.site }}
run: |
pnpm dlx wrangler@4.78.0 pages deploy "sites/${SITE}/dist" \
--project-name="wheels-${SITE}" \
--branch="${DEPLOY_BRANCH}" \
--commit-hash="${GITHUB_SHA}"
visual-regression:
name: Visual regression
# Hard gate as of 2026-04. Baselines soaked through the initial
# Phase 3 rollout (#2158, #2159, #2160, #2161, #2162). If this job
# fails on your PR and the change is intentional, download the
# `visual-regression-diffs` artifact and copy each `*.actual.png`
# over the matching `web/tests/visual-baselines/*.png`, commit,
# and push.
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up pnpm
uses: pnpm/action-setup@v5
with:
version: 10.23.0
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Install dependencies
working-directory: web
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v5
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('web/pnpm-lock.yaml') }}
- name: Install Playwright Chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: web
run: pnpm exec playwright install --with-deps chromium
- name: Build all sites
working-directory: web
run: pnpm build
- name: Run visual regression
working-directory: web
run: pnpm visual:test
- name: Upload diffs on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: visual-regression-diffs
path: |
web/tests/visual-diffs/*.png
web/tests/visual-baselines/*.png
if-no-files-found: ignore
retention-days: 14