|
1 | | -## ~~Github Actions~~ |
2 | | - |
3 | | -> [!WARNING] |
4 | | -> Due to changes in Cloudflare, the one-click deployment feature is temporarily unavailable. Please use command deployment. |
5 | | -
|
6 | | -~~Click the button above, follow the instructions of Cloudflare to complete the deployment. )~~ |
7 | | - |
8 | | ->[!IMPORTANT] |
9 | | -> ~~R2 storage bucket is a feature that needs to be manually enabled in the Cloudflare panel, please enable it before deployment or re-run Github Actions after failure.~~ |
10 | | -> ~~You only need to enable the R2 feature, no need to create a storage bucket, the storage bucket will be created automatically during deployment. ~~ |
11 | | -
|
12 | | -> [!NOTE] |
13 | | -> ~~When creating a token, select the `Edit Cloudflare Workers` template directly, and then manually add the `D1 Edit` permission.~~ |
14 | | -
|
15 | | - |
16 | | - |
17 | | -~~Once deployed, please login as soon as possible, the first user to login will be set as the administrator.~~ |
18 | | - |
| 1 | +## GitHub Actions Deployment |
| 2 | + |
| 3 | +### 1. Fork this repository on GitHub |
| 4 | + |
| 5 | +First, fork this repository to your own GitHub account. The deployment configuration and workflow runs will be done in your forked repository. |
| 6 | + |
| 7 | +### 2. Prepare Cloudflare credentials |
| 8 | + |
| 9 | +You need to prepare the following two GitHub Actions secrets in Cloudflare: |
| 10 | + |
| 11 | +- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare account ID. See [Find account and zone IDs - Cloudflare Fundamentals docs](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/) for how to find it. |
| 12 | +- `CLOUDFLARE_API_TOKEN`: A token used by GitHub Actions to call the Cloudflare API. You can create it on the [API Tokens | Cloudflare](https://dash.cloudflare.com/profile/api-tokens) page. |
| 13 | + |
| 14 | +> [!IMPORTANT] |
| 15 | +> The `R2` feature must be enabled manually in the Cloudflare dashboard before deployment. If the first workflow run fails because `R2` is not enabled yet, enable it and rerun the GitHub Actions workflow. |
| 16 | +> You only need to enable the `R2` feature. You do not need to create the bucket manually. The deployment will create the `web-archive` bucket automatically. |
| 17 | + |
| 18 | +> [!NOTE] |
| 19 | +> When creating the token, choose the `Edit Cloudflare Workers` template first, then manually add the `D1 Edit` permission. |
| 20 | +> Set Account Resources to "All accounts" and Zone Resources to "All zones". |
| 21 | + |
| 22 | +For reference, the Cloudflare API token permissions should look like this: |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +### 3. Configure GitHub Actions secrets in your fork |
| 27 | + |
| 28 | +Go to `Settings -> Secrets and variables -> Actions` in your forked repository, then create these two repository secrets: |
| 29 | + |
| 30 | +- `CLOUDFLARE_ACCOUNT_ID` |
| 31 | +- `CLOUDFLARE_API_TOKEN` |
| 32 | + |
| 33 | +The Secrets configuration page looks like this: |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +### 4. Enable GitHub Actions and run the deployment workflow |
| 38 | + |
| 39 | +Open the `Actions` page in your forked repository. If GitHub shows that Actions are disabled for the fork, enable them first. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +After Actions are enabled, select the `Deploy` workflow from the workflow list, then click `Run workflow` to trigger deployment manually. |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +> [!IMPORTANT] |
| 48 | +> After deployment, log in as soon as possible. The first user to log in will be assigned as the administrator. |
| 49 | + |
| 50 | +After deployment finishes, you can find the service URL in the Cloudflare Workers dashboard. Use the formal URL without a hash, and do not copy the preview URL with a random hash. |
| 51 | + |
| 52 | + |
| 53 | + |
19 | 54 | ## Command Deploy |
20 | 55 |
|
21 | 56 | Requirements: Local installation of node environment. |
|
0 commit comments