Skip to content

Commit adc9091

Browse files
chore: add workflow to test Cloudflare Worker build on PRs and pushes
1 parent 6fd5656 commit adc9091

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Security Notes
2+
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions)
3+
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions.
4+
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
5+
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
6+
7+
name: Cloudflare OpenNext Build
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
pull_request_target:
14+
branches:
15+
- main
16+
types:
17+
- labeled
18+
19+
defaults:
20+
run:
21+
# This ensures that the working directory is the root of the repository
22+
working-directory: ./
23+
24+
permissions:
25+
contents: read
26+
actions: read
27+
28+
env:
29+
# See https://turbo.build/repo/docs/reference/command-line-reference/run#--cache-dir
30+
TURBO_ARGS: --cache-dir=.turbo/cache
31+
# See https://turbo.build/repo/docs/reference/command-line-reference/run#--force
32+
TURBO_FORCE: true
33+
34+
jobs:
35+
build-cloudflare-worker:
36+
name: Build Cloudflare Worker on ${{ matrix.os }}
37+
runs-on: ${{ matrix.os }}
38+
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
os: [ubuntu-latest, windows-latest]
43+
44+
steps:
45+
- name: Harden Runner
46+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
47+
with:
48+
egress-policy: audit
49+
50+
- name: Git Checkout
51+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
53+
- name: Set up pnpm
54+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
55+
with:
56+
cache: true
57+
58+
- name: Set up Node.js
59+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
60+
with:
61+
# We want to ensure that the Node.js version running here respects our supported versions
62+
node-version-file: '.nvmrc'
63+
cache: 'pnpm'
64+
65+
- name: Install packages
66+
run: pnpm install --frozen-lockfile
67+
68+
- name: Build Cloudflare Worker
69+
run: pnpm turbo run --filter=@node-core/website cloudflare:build:worker

0 commit comments

Comments
 (0)