Skip to content

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

  1. create a token using a template.

  2. Configure the required permissions.

  3. Copy the generated API token.

  4. Copy the Cloudflare account ID.

Environment Setup

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

  2. Configure GitHub Actions secrets.

Secret NameRequiredDescription
CLOUDFLARE_API_TOKENCloudflare API token
CLOUDFLARE_ACCOUNT_IDCloudflare account ID
D1_DATABASE_IDD1 database ID
KV_NAMESPACE_IDKV namespace ID
DOMAINEmail domains: ["example.com", "example2.com"]
ADMINAdministrator email address, for example [email protected]
JWT_SECRETJWT secret key (any random string)

Deployment

  1. Run the GitHub Actions workflow.

  2. Wait for the workflow to complete.

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

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

Email Receiving

  1. Open the domain settings.

  2. Configure the email forwarding Worker.

  3. Send a test email to verify message delivery.