Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: Deploy to ${{ github.ref_name }}
run: npx wrangler deploy --env ${{ github.ref_name }} --outdir dist-worker --minify --var SENTRY_DSN:${{ secrets.SENTRY_DSN }} --var SENTRY_RELEASE:${{ github.sha }}
env:
CLOUDFLARE_API_TOKEN: ${{ github.ref_name == 'production' && secrets.CLOUDFLARE_API_TOKEN_PRODUCTION || secrets.CLOUDFLARE_API_TOKEN_STAGING }}
CLOUDFLARE_ACCOUNT_ID: ${{ github.ref_name == 'production' && secrets.CLOUDFLARE_ACCOUNT_ID_PRODUCTION || secrets.CLOUDFLARE_ACCOUNT_ID_STAGING }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_CDNJS_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_CDNJS_ACCOUNT_ID }}

- name: Create Sentry Release
uses: getsentry/action-release@dab6548b3c03c4717878099e43782cf5be654289 # v3.5.0
Expand Down
9 changes: 4 additions & 5 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "cdnjs-api-worker"
main = "src/index.js"
compatibility_date = "2022-10-31"
compatibility_flags = [ "nodejs_als" ]
account_id = "dbf163e9a5fda1c8a0eceeed9ec12c18"
kv_namespaces = [
{ binding = "CACHE", id = "845ae1599dcf4d75950b61201a951b73", preview_id = "845ae1599dcf4d75950b61201a951b73" }
{ binding = "CACHE" }
]

[observability.logs]
Expand All @@ -23,9 +24,8 @@ SENTRY_RELEASE = ""
SENTRY_ENVIRONMENT = "development"

[env.staging]
route = { pattern = "api.cdnjs.dev/*", zone_name = "cdnjs.dev" }
kv_namespaces = [
{ binding = "CACHE", id = "34b159dab6f840ce9c17e4d0730ead12" }
{ binding = "CACHE", id = "01c2862d489743a1b87c4ce338279392" }
]

[env.staging.vars]
Expand All @@ -37,9 +37,8 @@ SENTRY_RELEASE = "" # Will be injected by build pipeline
SENTRY_ENVIRONMENT = "staging"

[env.production]
route = { pattern = "api.cdnjs.com/*", zone_name = "cdnjs.com" }
kv_namespaces = [
{ binding = "CACHE", id = "c2922fcf1af643658d6769859b913134" }
{ binding = "CACHE", id = "6a1fda0afa5a4b73af5302f40b34752c" }
]

[env.production.observability.logs]
Expand Down
Loading