GitHub Actions Deployment
Account Preparation
Register a Cloudflare account at https://dash.cloudflare.com and add your domain.

Database Creation
Create a D1 database and copy its ID, which will be used later when configuring the environment. 
Create a KV namespace and copy the namespace ID. 
API Token Creation
create a token using a template.

Configure the required permissions.

Copy the generated API token.

Copy the Cloudflare account ID.

Environment Setup
Fork the repository: https://github.com/maillab/cloud-mail

Configure GitHub Actions secrets.
| Secret Name | Required | Description |
|---|---|---|
| CLOUDFLARE_API_TOKEN | ✅ | Cloudflare API token |
| CLOUDFLARE_ACCOUNT_ID | ✅ | Cloudflare account ID |
| D1_DATABASE_ID | ✅ | D1 database ID |
| KV_NAMESPACE_ID | ✅ | KV namespace ID |
| DOMAIN | ✅ | Email domains: ["example.com", "example2.com"] |
| ADMIN | ✅ | Administrator email address, for example [email protected] |
| JWT_SECRET | ✅ | JWT secret key (any random string) |

Deployment
Run the GitHub Actions workflow.

Wait for the workflow to complete.

Return to the Cloudflare dashboard and configure a custom domain for the Worker.

Open the domain in a browser and register the admin account to sign in.

Email Receiving
Open the domain settings.

Configure the email forwarding Worker.


Send a test email to verify message delivery.

