Skip to content

Commit 552c8ad

Browse files
authored
Add npm install step (#335)
* add npm install step Signed-off-by: Nik Nasr <nik@restate.dev> * update readm Signed-off-by: Nik Nasr <nik@restate.dev> * update readme Signed-off-by: Nik Nasr <nik@restate.dev> * remove deno install Signed-off-by: Nik Nasr <nik@restate.dev> * update template Signed-off-by: Nik Nasr <nik@restate.dev> * PR feedback Signed-off-by: Nik Nasr <nik@restate.dev> --------- Signed-off-by: Nik Nasr <nik@restate.dev>
1 parent a74f965 commit 552c8ad

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

typescript/templates/cloudflare-worker/.github/workflows/deploy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
with:
1919
# Check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
2020
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
21+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2122
# Add a message to the deployment with the commit
22-
command: versions upload --message "Deployed via GitHub Actions - commit ${{ github.sha }}"
23+
command: versions upload --latest --message "Deployed via GitHub Actions - commit ${{ github.sha }}"
2324
- name: Get deployment URL
2425
id: get-url
2526
env:
@@ -34,4 +35,4 @@ jobs:
3435
RESTATE_ADMIN_URL: ${{ secrets.RESTATE_ADMIN_URL }}
3536
# Auth token with Admin Role. To get one, go to Developers > API Keys > Create API Key: https://cloud.restate.dev?createApiKey=true&createApiKeyDescription=deployment-key&createApiKeyRole=rst:role::AdminAccess
3637
RESTATE_AUTH_TOKEN: ${{ secrets.RESTATE_AUTH_TOKEN }}
37-
run: npx -y @restatedev/restate deployment register -y ${{ steps.get-url.outputs.deployment-url }}
38+
run: npx -y @restatedev/restate deployment register -y ${{ steps.get-url.outputs.deployment-url }}

typescript/templates/cloudflare-worker/README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,33 @@ Welcome to the **Restate TypeScript + Cloudflare Workers** template! ✨
55
## 🏁 Getting Started
66

77
### Prerequisites
8+
89
- 📦 Node.js 20+ installed
910
- 🔧 npm or yarn package manager
1011
- 🌐 Cloudflare account (for deployment)
1112

1213
## 🛠️ Local Development
1314

15+
Install dependencies:
16+
17+
```bash
18+
npm install
19+
```
20+
1421
Launch the local Restate server:
22+
1523
```bash
1624
npx @restatedev/restate-server
1725
```
1826

1927
Start the Cloudflare Workers development server:
28+
2029
```bash
2130
npm run dev
2231
```
2332

2433
Connect your local service to Restate:
34+
2535
```bash
2636
npx @restatedev/restate dep add http://localhost:9080 --use-http1.1
2737
```
@@ -36,12 +46,19 @@ Iterate! 🔧
3646

3747
This template includes a GitHub Actions workflow setup for automated deployment.
3848

39-
To set up the repository, add the following to **Github Actions repository secrets**:
49+
Create your CloudFlare Worker project. You can do so by running:
50+
51+
```shell
52+
npx wrangler deploy
53+
```
54+
55+
Add the following to **Github Actions repository secrets**:
4056

41-
- `CLOUDFLARE_API_TOKEN`: Your Cloudflare API token. To get a token, check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
57+
- `CLOUDFLARE_ACCOUNT_ID`: Your Cloudflare Account. To get your account id, check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/#cloudflare-account-id
58+
- `CLOUDFLARE_API_TOKEN`: Your Cloudflare API token. To get a token, check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/. You can use the "Edit Cloudflare Workers" template for creating a token.
4259
- `RESTATE_ADMIN_URL`: The Admin URL. You can find it in [Developers > Admin URL](https://cloud.restate.dev/to/developers/integration#admin)
4360
- `RESTATE_AUTH_TOKEN`: Your Restate Cloud auth token. To get one, go to [Developers > API Keys > Create API Key](https://cloud.restate.dev?createApiKey=true&createApiKeyDescription=deployment-key&createApiKeyRole=rst:role::AdminAccess), and make sure to select **Admin** for role
44-
<img src="https://raw.githubusercontent.com/restatedev/docs-restate/refs/heads/main/docs/img/services/deploy/deployment-token.png" style="width:50%;height:50%;" />
61+
<img src="https://raw.githubusercontent.com/restatedev/docs-restate/refs/heads/main/docs/img/services/deploy/deployment-token.png" style="width:50%;height:50%;" />
4562

4663
Once the repo is set up, **just push to the main branch** and you'll get your services updated.
4764

@@ -51,8 +68,8 @@ Check the [workflow deploy.yml](.github/workflows/deploy.yml) for more details.
5168

5269
For more info on how to deploy manually, check:
5370

54-
* For cloud: https://docs.restate.dev/cloud/connecting-services
55-
* For on-prem Restate deployments: https://docs.restate.dev/services/deploy/cloudflare-workers
71+
- For cloud: https://docs.restate.dev/cloud/connecting-services
72+
- For on-prem Restate deployments: https://docs.restate.dev/services/deploy/cloudflare-workers
5673

5774
## 🎯 Next Steps
5875

typescript/templates/lambda/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Welcome to the **Restate TypeScript + AWS Lambda** template! ✨
1111

1212
## 🛠️ Local Development
1313

14+
Install dependencies:
15+
```bash
16+
npm install
17+
```
18+
1419
Launch the local Restate server:
1520
```shell
1621
npx @restatedev/restate-server

typescript/templates/vercel/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Welcome to the **Restate TypeScript + Vercel** template! ✨
1111

1212
## 🛠️ Local Development
1313

14+
Install dependencies:
15+
```bash
16+
npm install
17+
```
18+
1419
Launch the local Restate server:
1520
```bash
1621
npx @restatedev/restate-server

0 commit comments

Comments
 (0)