diff --git a/.github/workflows/deploy-langgraph.yml b/.github/workflows/deploy-langgraph.yml index ea1cdfb..cd469bd 100644 --- a/.github/workflows/deploy-langgraph.yml +++ b/.github/workflows/deploy-langgraph.yml @@ -25,21 +25,15 @@ jobs: with: node-version: "20" - - name: Install pnpm and dependencies - run: | - npm install -g pnpm@10 - cd langgraph - pnpm install --frozen-lockfile - # Create .env placeholder (langgraphjs dev requires it) - touch .env - mkdir -p .langgraph_api - echo ".langgraph_api" >> .gitignore - - name: Package for deployment run: | cd langgraph + # Create langgraphjs dev prerequisites + touch .env + mkdir -p .langgraph_api + # Package source only — Oryx will install node_modules on Azure zip -r ../deploy-langgraph.zip . \ - -x ".git/*" "dist/*" ".DS_Store" + -x "node_modules/*" ".git/*" "dist/*" ".DS_Store" - name: Login to Azure uses: azure/login@v2 diff --git a/.github/workflows/main_soc-langgraph.yml b/.github/workflows/main_soc-langgraph.yml deleted file mode 100644 index 5b9048e..0000000 --- a/.github/workflows/main_soc-langgraph.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy -# More GitHub Actions for Azure: https://github.com/Azure/actions - -name: Build and deploy Node.js app to Azure Web App - soc-langgraph - -on: - push: - branches: - - main - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: read #This is required for actions/checkout - - steps: - - uses: actions/checkout@v4 - - - name: Set up Node.js version - uses: actions/setup-node@v3 - with: - node-version: '20.x' - - - name: npm install, build, and test - run: | - npm install - npm run build --if-present - npm run test --if-present - - - name: Upload artifact for deployment job - uses: actions/upload-artifact@v4 - with: - name: node-app - path: . - - deploy: - runs-on: ubuntu-latest - needs: build - permissions: - id-token: write #This is required for requesting the JWT - contents: read #This is required for actions/checkout - - steps: - - name: Download artifact from build job - uses: actions/download-artifact@v4 - with: - name: node-app - - - name: Login to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_8AFD875AB99C43E08E547E8C05B52C0E }} - tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_AED8BF6E858D44D589AE7C2EDFED2325 }} - subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_6BF05B223C23470E904C4CFECEB28649 }} - - - name: 'Deploy to Azure Web App' - id: deploy-to-webapp - uses: azure/webapps-deploy@v3 - with: - app-name: 'soc-langgraph' - slot-name: 'Production' - package: . - \ No newline at end of file diff --git a/langgraph/startup.sh b/langgraph/startup.sh new file mode 100755 index 0000000..b087316 --- /dev/null +++ b/langgraph/startup.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +echo "=== LangGraph Server Startup ===" + +cd /home/site/wwwroot + +# Ensure langgraphjs dev prerequisites exist +touch .env +mkdir -p .langgraph_api + +# Install pnpm globally if not available +if ! command -v pnpm &> /dev/null; then + echo "Installing pnpm..." + npm install -g pnpm@10 +fi + +# Install dependencies if node_modules is missing (Oryx should have done this, but fallback) +if [ ! -d "node_modules" ]; then + echo "node_modules not found, installing dependencies..." + 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