From 370726c811829271ae840581f06a9f8de85443f1 Mon Sep 17 00:00:00 2001 From: gongzhiyong Date: Fri, 10 Apr 2026 15:49:56 +0800 Subject: [PATCH] fix(deploy): use Azure-injected PORT instead of hardcoded 2024 - startup.sh now reads ${PORT:-8080} so Azure App Service can inject the correct port via its PORT environment variable - Removed obsolete deploy-backend.yml and deploy-frontend.yml workflows (old Python backend and Next.js frontend pipelines) - Removed WEBSITES_PORT=2024 from soc-langgraph Azure config Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/workflows/deploy-backend.yml | 52 --------------------------- .github/workflows/deploy-frontend.yml | 26 -------------- langgraph/startup.sh | 4 +-- 3 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 .github/workflows/deploy-backend.yml delete mode 100644 .github/workflows/deploy-frontend.yml mode change 100755 => 100644 langgraph/startup.sh diff --git a/.github/workflows/deploy-backend.yml b/.github/workflows/deploy-backend.yml deleted file mode 100644 index cc36e72..0000000 --- a/.github/workflows/deploy-backend.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Deploy Backend to Azure - -on: - push: - branches: [main] - paths: - - "backend/**" - - ".github/workflows/deploy-backend.yml" - workflow_dispatch: - -permissions: - id-token: write - contents: read - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python 3.12 - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install dependencies and create package - run: | - cd backend - pip install -r requirements.txt --target=".python_packages/lib/site-packages" - zip -r ../deploy.zip . -x ".venv/*" ".env" "__pycache__/*" "*.pyc" ".git/*" "tests/*" - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_E361D63054AD449285A5D65AA4425533 }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_62D66D4E65AC4A6C872064AD668AC691 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5D7B0564A55F4209A91149F2642D3F69 }} - - - name: Configure startup command - run: | - az webapp config set \ - --name soc-backend \ - --resource-group Operation \ - --startup-file startup.sh - - - name: Deploy to Azure Web App - uses: azure/webapps-deploy@v3 - with: - app-name: soc-backend - package: deploy.zip diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml deleted file mode 100644 index 30224a8..0000000 --- a/.github/workflows/deploy-frontend.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Deploy Frontend to Azure Static Web App - -on: - push: - branches: [main] - paths: - - "frontend/**" - - ".github/workflows/deploy-frontend.yml" - workflow_dispatch: - -jobs: - build-and-deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Deploy to Azure Static Web Apps - uses: Azure/static-web-apps-deploy@v1 - with: - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} - repo_token: ${{ secrets.GITHUB_TOKEN }} - action: upload - app_location: frontend - output_location: out diff --git a/langgraph/startup.sh b/langgraph/startup.sh old mode 100755 new mode 100644 index b087316..d0c020e --- a/langgraph/startup.sh +++ b/langgraph/startup.sh @@ -21,5 +21,5 @@ if [ ! -d "node_modules" ]; then pnpm install --frozen-lockfile fi -echo "Starting LangGraph server on port 2024..." -exec npx langgraphjs dev --host 0.0.0.0 --port 2024 --no-browser +echo "Starting LangGraph server on port ${PORT:-8080}..." +exec npx langgraphjs dev --host 0.0.0.0 --port ${PORT:-8080} --no-browser