mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
## Summary - **Fix CI build failure**: Auth0Client crashes during Next.js prerendering when env vars aren't set. Returns a no-op stub (`getSession → null`) when domain is missing — semantically correct for static generation - **Lazy-load markdown libs (~260kb)**: ReactMarkdown, remarkGfm, and react-syntax-highlighter were eagerly imported in monaco-diff-viewer but only rendered when user expands "Generated Tests". Extracted into a dynamic component - **Parallelize repo detail query**: `getRepositoryById` ran the activity count sequentially after the repo lookup. Since `repoId` is already available, all three queries now run in parallel ## Test plan - [ ] CI `build` check passes (was failing since #2598) - [ ] Trace page still renders generated tests correctly when expanded - [ ] Repository detail page loads correctly with activity status
102 lines
2.9 KiB
YAML
102 lines
2.9 KiB
YAML
name: Deploy CFAPI to Azure App Service
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "js/cf-api/**"
|
|
- ".github/workflows/deploy_cfapi_to_azure.yml"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
packages: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
registry-url: https://npm.pkg.github.com
|
|
scope: "@codeflash-ai"
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10
|
|
|
|
- name: Install dependencies
|
|
working-directory: js
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build and package app
|
|
run: |
|
|
cd js/cf-api
|
|
pnpm build
|
|
# Create deployment package with correct structure
|
|
mkdir -p deployment
|
|
cp -r dist deployment/
|
|
cp -r node_modules deployment/
|
|
cp -r node_modules deployment/dist/
|
|
cp package.json deployment/
|
|
cp -r resend deployment/
|
|
# Ensure markdown files are included
|
|
mkdir -p deployment/dist/github
|
|
cp -r github/*.md deployment/dist/github/
|
|
cd deployment
|
|
zip -r ../cfapi.zip .
|
|
|
|
- name: Upload artifact for deployment jobs
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: cfapi-artifact
|
|
path: js/cf-api/cfapi.zip
|
|
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
environment:
|
|
name: "dev"
|
|
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
|
|
permissions:
|
|
id-token: write #This is required for requesting the JWT
|
|
|
|
steps:
|
|
- name: Download artifact from build job
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: cfapi-artifact
|
|
|
|
# - name: Unzip artifact for deployment
|
|
# run: unzip cfapi.zip
|
|
# no need when doing run-from-zip
|
|
|
|
- name: Login to Azure
|
|
uses: azure/login@v3
|
|
with:
|
|
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
|
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
|
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
|
|
|
|
# - name: show me what's in the current directory
|
|
# run: pwd && ls -la
|
|
|
|
- name: "Deploy to Azure App Service - codeflash-api-dev.azurewebsites.net"
|
|
uses: azure/webapps-deploy@v3
|
|
id: deploy-to-webapp
|
|
with:
|
|
app-name: "codeflash-api"
|
|
slot-name: "dev"
|
|
# if we deploy a zip we can do Run-From-Zip and skip the oryx build step (which fails if we do a regular zip-deploy because it thinks the project is php for some reason)
|
|
# https://learn.microsoft.com/en-us/azure/app-service/deploy-run-package#enable-running-from-package
|
|
package: "cfapi.zip"
|
|
clean: true
|