-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (40 loc) · 1.17 KB
/
deploy-preview.yml
File metadata and controls
40 lines (40 loc) · 1.17 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
name: deploy
on:
pull_request:
branches: [main]
jobs:
preview:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- run: pnpm install
- name: Build
run: pnpm build
env:
NITRO_PRESET: cloudflare-module
CLOUDFLARE_ENV: preview
NODE_OPTIONS: --max-old-space-size=4096
- name: Upload Preview Version
id: preview
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: .output
preCommands: wrangler d1 migrations apply DB --remote --config server/wrangler.json
command: versions upload
- name: Comment Preview URL
uses: marocchino/sticky-pull-request-comment@v3
with:
header: deploy-preview
message: |
**Preview Deployment**
${{ steps.preview.outputs.deployment-url }}