npm run deployThis command will:
- Build the application
- Deploy it to Cloudflare Workers
Build and deploy separately:
npm run build
wrangler deployThe repository includes a built-in GitHub Actions workflow (.github/workflows/deploy.yml) for automatic deployment.
Trigger conditions:
- Push to
mainormasterbranch - Manual
workflow_dispatch
Workflow steps:
Checkout → Node 20 → npm ci → Generate wrangler.jsonc → npm run build → D1 migrations → wrangler deploy
- Cloudflare account with Workers and D1 enabled
- D1 database created
- Cloudflare API Token with Workers and D1 permissions
- Code pushed to GitHub repository
Add the following secrets in "Settings → Secrets and variables → Actions → Secrets":
| Secret | Description | Required |
|---|---|---|
CLOUDFLARE_API_TOKEN |
Cloudflare API Token | Yes |
CLOUDFLARE_ACCOUNT_ID |
Cloudflare Account ID | Yes |
ADMIN_USERNAME |
Admin username | Yes |
ADMIN_PASSWORD |
Admin password | Yes |
WEBDAV_USERNAME |
WebDAV username | No |
WEBDAV_PASSWORD |
WebDAV password | No |
Add variables in "Settings → Secrets and variables → Actions → Variables":
| Variable | Default | Description |
|---|---|---|
WORKER_NAME |
clist |
Worker name |
WORKER_MAIN |
./workers/app.ts |
Worker entry |
COMPATIBILITY_DATE |
2025-04-04 |
Workers compatibility date |
D1_DATABASE_NAME |
clist |
D1 database name |
D1_DATABASE_ID |
(empty) | Leave empty for auto-lookup |
D1_BINDING |
DB |
D1 binding name |
D1_MIGRATIONS_DIR |
./migrations |
Migrations directory |
OBSERVABILITY_ENABLED |
true |
Observability toggle |
SITE_TITLE |
(empty) | Site title |
SITE_ANNOUNCEMENT |
(empty) | Site announcement |
CHUNK_SIZE_MB |
(empty) | Upload chunk size |
WEBDAV_ENABLED |
(empty) | true / false |
- Push code to
mainormasterbranch for automatic deployment. - Go to GitHub Actions, select "Deploy to Cloudflare Workers", and click "Run workflow" for manual trigger.
- Verify the script is updated in the Cloudflare Workers dashboard.
- Visit your domain or the default Workers domain to check the page and API.