Skip to content

Commit 2806cd2

Browse files
committed
ci: add GitHub Actions workflow for automatic Cloudflare deployment
- Add deploy.yml workflow that triggers on push to main - Builds shared package, web app, and deploys to Cloudflare Workers - Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets - Update README with setup instructions for automatic deployment
1 parent d28d04c commit 2806cd2

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to Cloudflare
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
name: Deploy
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build shared package
27+
run: npm run build -w packages/shared
28+
29+
- name: Build web app
30+
run: npm run build -w apps/web
31+
32+
- name: Deploy to Cloudflare Workers
33+
uses: cloudflare/wrangler-action@v3
34+
with:
35+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
36+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
37+
workingDirectory: apps/api
38+
command: deploy

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,24 @@ npm run dev
164164

165165
### 7. Deploy to Production
166166

167+
#### Option A: Automatic Deployment (Recommended)
168+
169+
The project includes a GitHub Actions workflow that automatically deploys to Cloudflare when you push to `main`.
170+
171+
**Setup GitHub Secrets:**
172+
173+
1. Go to your repository on GitHub → Settings → Secrets and variables → Actions
174+
2. Add these secrets:
175+
- `CLOUDFLARE_API_TOKEN`: Create at [Cloudflare API Tokens](https://dash.cloudflare.com/profile/api-tokens) with "Edit Cloudflare Workers" permissions
176+
- `CLOUDFLARE_ACCOUNT_ID`: Find in the Cloudflare dashboard URL or Workers overview page
177+
178+
Once configured, every push to `main` will automatically:
179+
1. Build the shared package
180+
2. Build the web frontend
181+
3. Deploy to Cloudflare Workers
182+
183+
#### Option B: Manual Deployment
184+
167185
Kivo deploys as a single Cloudflare Worker with static assets:
168186

169187
```bash

0 commit comments

Comments
 (0)