Skip to content

Commit 1835c06

Browse files
authored
Merge pull request #3 from filecoin-station/fix-deployment
Fix deployment
2 parents d0c17ef + e3fcee0 commit 1835c06

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- run: cp wrangler.toml.example wrangler.toml
1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 20
16+
node-version: 22
1717
- run: npm ci
1818
- run: npm test
1919

@@ -27,6 +27,7 @@ jobs:
2727
uses: cloudflare/wrangler-action@v3
2828
with:
2929
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
30+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3031
preCommands: |
3132
cp wrangler.toml.example wrangler.toml
3233
envsubst < wrangler.toml.example > wrangler.toml
@@ -36,7 +37,7 @@ jobs:
3637
secrets: |
3738
INFLUX_TOKEN
3839
env:
39-
INFLUX_METRIC_NAME: ${{ env.INFLUX_METRIC }}
40-
INFLUX_URL: ${{ env.INFLUX_URL }}
40+
INFLUX_METRIC_NAME: ${{ vars.INFLUX_METRIC_NAME }}
41+
INFLUX_URL: ${{ vars.INFLUX_URL }}
4142
INFLUX_TOKEN: ${{ secrets.INFLUX_TOKEN }}
42-
INFLUX_DATABASE: ${{ env.INFLUX_DATABASE }}
43+
INFLUX_DATABASE: ${{ vars.INFLUX_DATABASE }}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ cp wrangler.toml.example wrangler.toml
2525
npm run dev
2626
```
2727

28-
## Deployment to production
28+
## Deployment (Github Actions)
2929

3030
In order to deploy your worker via Github Actions, you need to have a [Cloudflare API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) and running instance of InfluxDB.
3131

@@ -34,4 +34,6 @@ Add generated API token to Github secrets as `CLOUDFLARE_API_TOKEN` and authenti
3434
Other required environment variables include the following:
3535
- `INFLUX_URL` - InfluxDB URL
3636
- `INFLUX_DATABASE` - InfluxDB database (bucket) name
37-
- `INFLUX_METRIC_NAME` - InfluxDB metric name
37+
- `INFLUX_METRIC_NAME` - InfluxDB metric name
38+
39+
After setting up secrets, you can push your code to Github and worker will be deployed to production environment automatically.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"description": "A template for kick starting a Cloudflare Workers project",
66
"main": "index.js",
77
"scripts": {
8-
"deploy": "wrangler deploy",
9-
"deploy:prod": "wrangler deploy --env production",
8+
"deploy": "wrangler deploy --env production",
9+
"deploy:dev": "wrangler deploy --env dev",
1010
"dev": "wrangler dev --env dev",
1111
"start": "wrangler dev",
1212
"test": "vitest run",

0 commit comments

Comments
 (0)