Skip to content

deploy cf modules #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/cloudflare-module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cloudflare

on:
push:
branches:
- main
- cloudflare

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: 20
cache: pnpm
- run: pnpm install
- run: pnpm build
env:
NITRO_PRESET: cloudflare-module
- run: npx wrangler deploy --env modules
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
- name: Test deployed site
run: pnpm test:deployment
env:
DEPLOYMENT_URL: https://nitro-deployment-modules.pi0.workers.dev/
8 changes: 7 additions & 1 deletion deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,17 @@ export const deployments = [
docs: "https://nitro.unjs.io/deploy/providers/azure",
},
{
name: "Cloudflare Workers",
name: "Cloudflare Workers - Service Worker",
enabled: true,
url: "https://nitro-deployment.pi0.workers.dev/",
docs: "https://nitro.unjs.io/deploy/providers/cloudflare",
},
{
name: "Cloudflare Workers - Module",
enabled: true,
url: "https://nitro-deployment.pi0.workers.dev/",
docs: "https://nitro.unjs.io/deploy/providers/cloudflare#cloudflare-module-workers",
},
{
name: "DigitalOcean",
enabled: false,
Expand Down
3 changes: 3 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ compatibility_date = "2022-11-30"

[site]
bucket = ".output/public"

[env.modules]
name = "nitro-deployment-modules"