Skip to content

Commit 6697976

Browse files
committed
docs: update GitHub Actions deployment guide and screenshots
1 parent 26b3309 commit 6697976

3 files changed

Lines changed: 53 additions & 20 deletions

File tree

docs/deploy.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ Secrets 配置页面如下:
5050
部署完成后,可以在 Cloudflare Workers 页面中找到服务的访问链接。访问时请使用不带 hash 的正式链接,不要复制带随机 hash 的预览链接。
5151
![Cloudflare Workers 页面中的访问链接位置](./imgs/cloudflare_workers_page.png)
5252

53-
图:Cloudflare Workers 页面中访问链接位置示意。
54-
5553
## 命令部署
5654

5755
要求本地已安装 Node 环境。

docs/en/deploy.md

Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,56 @@
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-
![permissions](https://raw.githubusercontent.com/ray-d-song/web-archive/main/docs/imgs/perm.png)
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+
![Cloudflare API token permissions](https://raw.githubusercontent.com/ray-d-song/web-archive/main/docs/imgs/perm.png)
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+
![GitHub Actions secrets page](../imgs/actions_secrets.png)
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+
![Enable GitHub Actions](../imgs/actions_enable.png)
42+
43+
After Actions are enabled, select the `Deploy` workflow from the workflow list, then click `Run workflow` to trigger deployment manually.
44+
45+
![Run the Deploy workflow](../imgs/actions_deploy.png)
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+
![Service URL in the Cloudflare Workers dashboard](../imgs/cloudflare_workers_page_en.png)
53+
1954
## Command Deploy
2055

2156
Requirements: Local installation of node environment.
44.5 KB
Loading

0 commit comments

Comments
 (0)