You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Github Action部署Azure App Service失败求助

问题:Github Action部署Next.js到Azure App Service失败(Kudu Sync被终止)

背景

使用Github Action将Next.js项目部署至Azure App Service,流程为构建项目后部署到staging槽,完成后与生产槽交换。该脚本此前运行正常,但今日突然失败。查阅相关解答后,部分提及的设置在Azure控制台中无法找到。

Github Action配置文件

name: Build and deploy Node.js app to Azure Web App

on:
  push:
    branches:
      - dev
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Set Node.js 16.x
        uses: actions/setup-node@v3
        with:
          node-version: 16.x

      - name: npm install, build, and test
        run: |
          npm install
          npm run build --if-present
          npm run test --if-present
      - name: Archive Build Output
        run: |
          zip -r build.zip . -x "*.git*"
      - name: Upload artifact for deployment job
        uses: actions/upload-artifact@v3
        with:
          name: node-app
          path: build.zip # This will upload only the build.zip as an artifact

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: "dev"
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

    steps:
      - name: Download artifact from build job
        uses: actions/download-artifact@v3
        with:
          name: node-app

      - name: Login to Azure
        uses: azure/login@v1
        with:
          creds: ${{ secrets.AZURE_CREDENTIALS }}

      - name: "Deploy to Azure Web App"
        id: deploy-to-webapp
        uses: azure/webapps-deploy@v2
        with:
          app-name: "app-testing"
          slot-name: "staging"
          package: build.zip
        env:
          # list of env variables

      - name: Health check
        uses: jtalk/url-health-check-action@v1.2
        with:
          url: http://app-testing-staging.azurewebsites.net/health
          max-attempts: 2s
          retry-delay: 5s

      - name: Azure Swap Slots
        uses: azure/CLI@v1
        with:
          inlineScript: |
            az webapp deployment slot swap --slot staging --name kendal-testing --resource-group kendal --target-slot production

错误日志

/home/site/deployments/tools/deploy.sh: line 82:  2218 Killed                  "$KUDU_SYNC_CMD" -v 50 $IGNORE_MANIFEST_PARAM -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh"
An error has occurred during web site deployment.
Kudu Sync failed
/home/site/deployments/tools/deploy.sh: line 82:  2218 Killed                  "$KUDU_SYNC_CMD" -v 50 $IGNORE_MANIFEST_PARAM -f "$DEPLOYMENT_SOURCE" -t "$DEPLOYMENT_TARGET" -n "$NEXT_MANIFEST_PATH" -p "$PREVIOUS_MANIFEST_PATH" -i ".git;.hg;.deployment;deploy.sh"
/opt/Kudu/Scripts/starter.sh "/home/site/deployments/tools/deploy.sh"
Deployment Failed. deployer = GITHUB_ZIP_DEPLOY deploymentPath = ZipDeploy. Extract zip.
Error: Failed to deploy web package to App Service.
Error: Deployment Failed, Package deployment using ZIP Deploy failed. Refer logs for more details.

补充信息

  • App Service使用Standard S1计划
  • 在部署中心未找到部分解答中提到的Disconnect选项(截图:部署中心界面)
  • 无法确定问题出在Action代码还是App Service配置,可提供更多细节

内容的提问来源于stack exchange,提问作者Ritvij Sharma

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 20:04:58