Skip to content

GitHub Action Deployment

Configure GitHub Repository

  1. Fork or clone the repository https://github.com/eoao/cloud-mail
  2. Go to your GitHub repository settings
  3. Navigate to Settings → Secrets and variables → Actions → New repository secret
  4. Add the following Secrets:
Secret NameRequiredPurpose
CLOUDFLARE_API_TOKENCloudflare API token (needs permissions for Workers and related resources)
CLOUDFLARE_ACCOUNT_IDCloudflare Account ID
D1_DATABASE_IDYour D1 database ID
KV_NAMESPACE_IDYour KV namespace ID
R2_BUCKET_NAMEYour R2 bucket name
DOMAINThe domain(s) for your mail service (e.g., ["xx.xx"], separate multiple domains with commas)
ADMINYour admin email address (e.g., [email protected])
JWT_SECRETA random long string used to generate and verify JWTs
INIT_URL(Optional) Worker URL used to initialize the database after deployment (see manual initialization below)

Obtain Cloudflare API Token

  1. Visit Cloudflare Dashboard
  2. Create a new API token
  3. Choose the "Edit Cloudflare Workers" template and add the necessary permissions as shown below
    dc2e1dc8dcd217644759c46c6c705de1
  4. Save the token and copy it into the GitHub Secret named CLOUDFLARE_API_TOKEN

Obtain Cloudflare Account ID

  1. Find your Account ID in the Cloudflare dashboard under Account settings.
  2. Copy it to the GitHub Secret named CLOUDFLARE_ACCOUNT_ID

Run the Workflow

  1. Manually trigger the workflow on the Actions page. Subsequent upstream syncs will automatically deploy to Cloudflare Workers.
    If INIT_URL is not configured, you will need to manually visit https://your-project-domain/api/init/your-jwt_secret to initialize the database.
  2. Upstream synchronization can be done automatically using a bot or manually by clicking the Sync Upstream button.