GitHub Action Deployment
Configure GitHub Repository
- Fork or clone the repository https://github.com/eoao/cloud-mail
- Go to your GitHub repository settings
- Navigate to Settings → Secrets and variables → Actions → New repository secret
- Add the following Secrets:
Secret Name | Required | Purpose |
---|---|---|
CLOUDFLARE_API_TOKEN | ✅ | Cloudflare API token (needs permissions for Workers and related resources) |
CLOUDFLARE_ACCOUNT_ID | ✅ | Cloudflare Account ID |
D1_DATABASE_ID | ✅ | Your D1 database ID |
KV_NAMESPACE_ID | ✅ | Your KV namespace ID |
R2_BUCKET_NAME | ✅ | Your R2 bucket name |
DOMAIN | ✅ | The domain(s) for your mail service (e.g., ["xx.xx"] , separate multiple domains with commas) |
ADMIN | ✅ | Your admin email address (e.g., [email protected] ) |
JWT_SECRET | ✅ | A 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
- Visit Cloudflare Dashboard
- Create a new API token
- Choose the "Edit Cloudflare Workers" template and add the necessary permissions as shown below
- Save the token and copy it into the GitHub Secret named
CLOUDFLARE_API_TOKEN
Obtain Cloudflare Account ID
- Find your Account ID in the Cloudflare dashboard under Account settings.
- Copy it to the GitHub Secret named
CLOUDFLARE_ACCOUNT_ID
Run the Workflow
- Manually trigger the workflow on the Actions page. Subsequent upstream syncs will automatically deploy to Cloudflare Workers.
IfINIT_URL
is not configured, you will need to manually visithttps://your-project-domain/api/init/your-jwt_secret
to initialize the database. - Upstream synchronization can be done automatically using a bot or manually by clicking the Sync Upstream button.