Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deployment #3

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- run: cp wrangler.toml.example wrangler.toml
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- run: npm ci
- run: npm test

Expand All @@ -27,6 +27,7 @@ jobs:
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
preCommands: |
cp wrangler.toml.example wrangler.toml
envsubst < wrangler.toml.example > wrangler.toml
Expand All @@ -36,7 +37,7 @@ jobs:
secrets: |
INFLUX_TOKEN
env:
INFLUX_METRIC_NAME: ${{ env.INFLUX_METRIC }}
INFLUX_URL: ${{ env.INFLUX_URL }}
INFLUX_METRIC_NAME: ${{ vars.INFLUX_METRIC_NAME }}
INFLUX_URL: ${{ vars.INFLUX_URL }}
INFLUX_TOKEN: ${{ secrets.INFLUX_TOKEN }}
INFLUX_DATABASE: ${{ env.INFLUX_DATABASE }}
INFLUX_DATABASE: ${{ vars.INFLUX_DATABASE }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "A template for kick starting a Cloudflare Workers project",
"main": "index.js",
"scripts": {
"deploy": "wrangler deploy",
"deploy": "wrangler deploy --env dev",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why dev env?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If environment is not specified it will deploy to default environment. Since we have environment production defined, I thought it might be good to be explicit here. I can roll it back if you want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why would we deploy to the dev environment? Shouldn't we deploy to production? I would expect nom run deploy to do that. If you specifically want to deploy to dev, what about renaming the script to "deploy:dev"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found it useful to deploy during the development as many things like cache are not available out of the box. I do agree that the name might be a little off -- I'm renaming the script to deploy:dev and deploy:prod to deploy.

"deploy:prod": "wrangler deploy --env production",
"dev": "wrangler dev --env dev",
"start": "wrangler dev",
Expand Down
Loading