Skip to content

Commit

Permalink
feat: add staging environment for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ngshiheng committed May 18, 2022
1 parent 86f7cc6 commit 5c616a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ wrangler kv:namespace create "URL_DB" --preview

For creating these KV namespaces, remember to update your [`wrangler.toml`](./wrangler.toml) file to include the namespace bindings accordingly.

[Read more](https://developers.cloudflare.com/workers/wrangler/configuration/#configure-wranglertoml) about configuring `wrangler.toml`.

## Optional: CI/CD

1. This project uses [Wrangler actions](https://github.com/marketplace/actions/deploy-to-cloudflare-workers-with-wrangler) to automatically publish worker. To do so, add `CF_API_TOKEN` into your GitHub repository secrets. You can [create your API token](https://dash.cloudflare.com/profile/api-tokens) using the `Edit Cloudflare Workers` template.
Expand Down
26 changes: 20 additions & 6 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
name = "atomic-url"
type = "webpack"

account_id = "19a745c88f8264f29c608584b7e417ab"
zone_id = "e69d9e8116a9787a7c36dc16f6195ae2"
compatibility_date = "2021-12-26"

name = "atomic-url-dev"
workers_dev = true
kv_namespaces = [
{binding = "URL_DB", id = "7da8f192d2c1443a8b2ca76b22a8069f", preview_id = "ca7936b380a840908c035a88d1e76584"},
{ binding = "URL_DB", id = "", preview_id = "ca7936b380a840908c035a88d1e76584" },
]
route = ""
workers_dev = true
zone_id = "e69d9e8116a9787a7c36dc16f6195ae2"

[dev]
ip = "0.0.0.0"
local_protocol = "http"
port = 8787
upstream_protocol = "https"

[env.staging]
name = "atomic-url-staging"
workers_dev = true
kv_namespaces = [
{ binding = "URL_DB", id = "ca7936b380a840908c035a88d1e76584" },
]

[env.production]
name = "atomic-url"
route = "s.jerrynsh.com/*"
workers_dev = false
kv_namespaces = [
{ binding = "URL_DB", id = "7da8f192d2c1443a8b2ca76b22a8069f" },
]

0 comments on commit 5c616a9

Please sign in to comment.