Skip to content

feat: initial commit #4

feat: initial commit

feat: initial commit #4

Workflow file for this run

name: deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
deploy-production:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
env:
NITRO_PRESET: cloudflare-module
NODE_OPTIONS: --max-old-space-size=4096
- name: Apply D1 Migrations
run: npx wrangler d1 migrations apply DB --remote --config .output/server/wrangler.json
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy
run: npx wrangler --cwd .output deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
deploy-preview:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install node
uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
env:
NITRO_PRESET: cloudflare-module
CLOUDFLARE_ENV: preview
NODE_OPTIONS: --max-old-space-size=4096
- name: Apply D1 Migrations
run: npx wrangler d1 migrations apply DB --remote --config .output/server/wrangler.json --env preview
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy
run: npx wrangler --cwd .output deploy --env preview
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}