Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/deploy-cloudflare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy to Cloudflare Pages

on:
push:
branches:
- main # Trigger deployment on push to main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18' # Or the version required by chatbot-ui

- name: Install Dependencies
run: npm ci # Use ci for faster, reproducible builds

- name: Build Application
run: npm run build # Assumes build script is adapted for next-on-pages

- name: Publish to Cloudflare Pages
uses: cloudflare/wrangler-action@v3 # Use the official wrangler action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: chatbot-ui-cf
directory: .vercel/output/static # Default output dir for next-on-pages build
# Or use wrangler directly:
# command: pages deploy .vercel/output/static --project-name=chatbot-ui-cf --branch=${{ github.ref_name }} --commit-dirty=true
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prepare": "husky install",
"clean": "npm run lint:fix && npm run format:write",
"dev": "next dev",
"build": "next build",
"build": "npx @cloudflare/next-on-pages",
"start": "next start",
"lint": "next lint",
"lint:fix": "next lint --fix",
Expand Down Expand Up @@ -124,6 +124,7 @@
"tailwindcss": "^3.3.5",
"tailwindcss-animate": "^1.0.7",
"ts-node": "^10.9.2",
"typescript": "^5"
"typescript": "^5",
"@cloudflare/next-on-pages": "^1"
}
}
}