diff --git a/.github/workflows/cloudflare.yml b/.github/workflows/cloudflare.yml index aa9c3bd..56881a7 100644 --- a/.github/workflows/cloudflare.yml +++ b/.github/workflows/cloudflare.yml @@ -1,4 +1,4 @@ -name: Deploy to Cloudflare Pages +name: Deploy to Cloudflare Workers on: push: @@ -48,12 +48,12 @@ jobs: STUDIO_GITHUB_CLIENT_ID: ${{ secrets.STUDIO_GITHUB_CLIENT_ID }} STUDIO_GITHUB_CLIENT_SECRET: ${{ secrets.STUDIO_GITHUB_CLIENT_SECRET }} - - name: Publish to Cloudflare Pages + - name: Publish to Cloudflare Workers uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - command: pages deploy --branch=${{ env.BRANCH_NAME }} + command: deploy --branch=${{ env.BRANCH_NAME }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index 50de4f1..9ddb395 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -1,18 +1,29 @@ /* eslint-disable */ -// Generated by Wrangler by running `wrangler types` (hash: 7333ef017a5016b51354dce96a893062) -// Runtime types generated with workerd@1.20251217.0 2025-12-13 +// Generated by Wrangler by running `wrangler types` (hash: 730a20d40c88c8f7167cb4afae90a541) +// Runtime types generated with workerd@1.20251217.0 2025-12-13 nodejs_compat declare namespace Cloudflare { interface Env { CACHE: KVNamespace; - NUXT_PUBLIC_I18N_BASE_URL: string; - NUXT_API_URL: string; STUDIO_GITHUB_CLIENT_ID: string; STUDIO_GITHUB_CLIENT_SECRET: string; + NUXT_DISCORD_USER_ID: string; + NUXT_WAKATIME_CODING: string; + NUXT_WAKATIME_EDITORS: string; + NUXT_WAKATIME_LANGUAGES: string; + NUXT_WAKATIME_OS: string; + NUXT_WAKATIME_USER_ID: string; + NUXT_STATUS_PAGE: string; DB: D1Database; - AI: Ai; + ASSETS: Fetcher; } } interface Env extends Cloudflare.Env {} +type StringifyValues> = { + [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string; +}; +declare namespace NodeJS { + interface ProcessEnv extends StringifyValues> {} +} // Begin runtime types /*! ***************************************************************************** @@ -8594,7 +8605,7 @@ type AIGatewayHeaders = { [key: string]: string | number | boolean | object; }; type AIGatewayUniversalRequest = { - provider: AIGatewayProviders | string; + provider: AIGatewayProviders | string; // eslint-disable-line endpoint: string; headers: Partial; query: unknown; @@ -8610,7 +8621,7 @@ declare abstract class AiGateway { gateway?: UniversalGatewayOptions; extraHeaders?: object; }): Promise; - getUrl(provider?: AIGatewayProviders | string): Promise; + getUrl(provider?: AIGatewayProviders | string): Promise; // eslint-disable-line } interface AutoRAGInternalError extends Error { } diff --git a/wrangler.jsonc b/wrangler.jsonc index 8ce43fd..0711b6d 100644 --- a/wrangler.jsonc +++ b/wrangler.jsonc @@ -2,7 +2,26 @@ "$schema": "node_modules/wrangler/config-schema.json", "name": "artsite", "compatibility_date": "2025-12-13", - "pages_build_output_dir": "dist/public", + "compatibility_flags": [ + "nodejs_compat", + ], + "preview_urls": true, + "workers_dev": true, + "main": "./.output/server/index.mjs", + "routes": [ + { + "pattern": "v2.arthurdanjou.fr", + "zone_name": "arthurdanjou.fr", + "custom_domain": true + } + ], + "placement": { + "mode": "smart", + }, + "assets": { + "binding": "ASSETS", + "directory": "./.output/public/" + }, "d1_databases": [ { "binding": "DB", @@ -15,8 +34,18 @@ "id": "f0766ace1d24423ba6e5cac4fb8f2054" } ], - "ai": { - "binding": "AI", - "remote": true + "observability": { + "enabled": true, + "logs": { + "enabled": true, + "head_sampling_rate": 1, + "persist": true, + "invocation_logs": true + }, + "traces": { + "enabled": true, + "head_sampling_rate": 1, + "persist": true + } } } \ No newline at end of file