From c50f112e5f6d5294715d8605acce1b789cee9c50 Mon Sep 17 00:00:00 2001 From: Girish21 Date: Sun, 12 Jun 2022 15:34:02 +0530 Subject: [PATCH] update docs --- README.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7ed9610..03e003e 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,28 @@ Let's setup `wrangler` CLI [instalation](https://github.com/cloudflare/wrangler# npm i @cloudflare/wrangler -g ``` -After installation, log in to our Cloudflare account from the CLI. +After installation, log in to your Cloudflare account from the CLI. ```sh wrangler login ``` -Next, we have to add Cloudflare Account ID in the [`wrangler.toml`](./packages/worker/wrangler.toml). You can get the Account ID by visiting the [Workers Dashboard](https://dash.cloudflare.com). +Let's install the dependencies. -```toml -account_id = "xxx" +```sh +npm i ``` -Also, remember to change the worker's name while we're here. +Now we can set up the project. -```toml -name = "remix-worker" # can be any name +```sh +npm run setup ``` +The setup script will ask for your worker's name. It can be any name. And then, we also need to add the Account ID, which you can find by visiting the Cloudflare [Dashboard](https://dash.cloudflare.com). + +You can add the Worker name and the Account ID later to the [`wrangler.toml](packages/worker/wrangler.toml). + That's all we're ready to push to prod! 🚀 Before pushing to the worker via GitHub action, we have to configure the `CF_API_TOKEN` secret in GitHub. We can generate an API Token from [here](https://dash.cloudflare.com/profile/api-tokens). When presented with the list of templates to choose from, select the "Edit Cloudflare Workers" option. This template should have the necessary permissions to push a Worker from GitHub. Now we can commit the changes made to `wrangler.toml` and push the changes. @@ -57,8 +61,8 @@ git push ```sh npm i @cloudflare/wrangler -g wrangler login -# update wrangler.toml with the Account ID -# update Worker name +npm i +npm run setup # configure CF_API_TOKEN action secret git add -A -m "" git push