Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish21 committed Jun 12, 2022
1 parent 63cff83 commit c50f112
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 "<message>"
git push
Expand Down

0 comments on commit c50f112

Please sign in to comment.