diff --git a/.github/workflows/build-and-deploy-dev.yml b/.github/workflows/build-and-deploy-dev.yml index a0043ae..4ed0ad3 100644 --- a/.github/workflows/build-and-deploy-dev.yml +++ b/.github/workflows/build-and-deploy-dev.yml @@ -96,6 +96,6 @@ jobs: with: deploy_to_dev: true tag: ${{ needs.build.outputs.image_tag }} - deployment_type: app + playbook: artifact_module/artifact_deploy.yml artifact_url: ${{ github.server_url }}/${{ github.repository }}/releases/download/dev-latest/${{ needs.build.outputs.rpm_name }} artifact_type: rpm diff --git a/vite.config.ts b/vite.config.ts index 8d86bed..beaca41 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,38 +8,43 @@ export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), ''); console.log('API_KEY loaded:', env.API_KEY ? `[set, ${env.API_KEY.length} chars]` : 'MISSING'); - if (!env.API_KEY) { + if (mode === 'development' && !env.API_KEY) { throw new Error('API_KEY is not set. Add it to your .env file (e.g. API_KEY=your-key).'); } return { plugins: [react(), TanStackRouterVite()], server: { - proxy: { - // All /v1 routes including WebSocket - '/v1': { - target: 'http://localhost:8080', - changeOrigin: true, - ws: true, - configure: (proxy) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const p = proxy as any; - p.on('error', (err: Error) => { - console.log('proxy error', err); - }); - p.on('proxyReq', (proxyReq: { setHeader: (k: string, v: string) => void }) => { - proxyReq.setHeader('X-API-Key', env.API_KEY); - }); - p.on( - 'proxyReqWs', - (proxyReq: { setHeader: (k: string, v: string) => void }, req: { url: string }) => { - console.log('WebSocket proxy request:', req.url); - proxyReq.setHeader('X-API-Key', env.API_KEY); - } - ); - }, - }, - }, + proxy: env.API_KEY + ? { + // All /v1 routes including WebSocket + '/v1': { + target: 'http://localhost:8080', + changeOrigin: true, + ws: true, + configure: (proxy) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const p = proxy as any; + p.on('error', (err: Error) => { + console.log('proxy error', err); + }); + p.on('proxyReq', (proxyReq: { setHeader: (k: string, v: string) => void }) => { + proxyReq.setHeader('X-API-Key', env.API_KEY); + }); + p.on( + 'proxyReqWs', + ( + proxyReq: { setHeader: (k: string, v: string) => void }, + req: { url: string } + ) => { + console.log('WebSocket proxy request:', req.url); + proxyReq.setHeader('X-API-Key', env.API_KEY); + } + ); + }, + }, + } + : undefined, }, }; });