diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 251f762..1e4a07e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,6 +44,7 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + environment: ${{ github.event.release.prerelease && 'staging' || 'production' }} - name: Push changes run: git push diff --git a/wrangler.jsonc b/wrangler.jsonc index 04ca86d..c61b380 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -3,6 +3,7 @@ "name": "avatar-upload", "main": "src/index.ts", "compatibility_date": "2025-02-18", + "keep_vars": true, // "compatibility_flags": [ // "nodejs_compat" // ], @@ -32,11 +33,33 @@ }, "env": { "staging": { + "name": "avatar-upload-staging", + "r2_buckets": [ + { + "binding": "AVATAR_BUCKET", + "bucket_name": "avatar-storage" + }, + { + "binding": "HEADER_BUCKET", + "bucket_name": "header-storage" + } + ], "vars": { "ENVIRONMENT": "staging" } }, "production": { + "name": "avatar-upload", + "r2_buckets": [ + { + "binding": "AVATAR_BUCKET", + "bucket_name": "avatar-storage" + }, + { + "binding": "HEADER_BUCKET", + "bucket_name": "header-storage" + } + ], "vars": { "ENVIRONMENT": "production" }