Azure / actions-workflow-samples

Help developers to easily get started with GitHub Action workflows to deploy to Azure
https://github.com/Azure/actions
MIT License
447 stars 624 forks source link

Action Taking 30+ Minutes #144

Closed branburciaga closed 1 year ago

branburciaga commented 1 year ago

Hi,

Please let me know if this should be in a github-actions repo, but I am using the base config in the examples for NodeJS and our build/deploy is taking 30+ minutes every single time.

The Github Action gets stuck on Azure/functions-action@v1.

Any ideas why?

Here is my workflow.yml:


# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and Deploy

on:
  push:
    branches:
      - development
  workflow_dispatch:

env:
  AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
  NODE_VERSION: '18.x' # set this to the node version to use (supports 8.x, 10.x, 12.x)

jobs:
  build-and-deploy:
    runs-on: windows-latest
    steps:
      - name: 'Checkout GitHub Action'
        uses: actions/checkout@v2

      - name: Setup Node ${{ env.NODE_VERSION }} Environment
        uses: actions/setup-node@v1
        with:
          node-version: ${{ env.NODE_VERSION }}

      - name: 'Resolve Project Dependencies Using Npm'
        shell: pwsh
        run: |
          pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
          npm install
          npm run build --if-present
          npm run test --if-present
          popd

      - name: 'Run Azure Functions Action'
        uses: Azure/functions-action@v1
        id: fa
        with:
          app-name: 'my-func'
          slot-name: 'Production'
          package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
          publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE_DEV }}

And the Github Action debug logs below. It repeats this over and over:

##[debug]Deployment status: 1 'Building and Deploying 'a8c4f086abf04c2abeb4263447fe38d5'.'. retry after 5 seconds
##[debug]setting affinity cookie ["ARRAffinity=742cff616624b5c1aff4f543417be11e48cb7b9f10b45a143ff7ddcedc6fef4d;Path=/;HttpOnly;Secure;Domain=my-func.scm.azurewebsites.net","ARRAffinitySameSite=742cff616624b5c1aff4f543417be11e48cb7b9f10b45a143ff7ddcedc6fef4d;Path=/;HttpOnly;SameSite=None;Secure;Domain=my-func.scm.azurewebsites.net"]
##[debug][GET] https://my-func.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY_FUNCTIONS_V1&time=2023-05-24_18-31-48Z
##[debug]POLL URL RESULT: {"statusCode":202,"statusMessage":"Accepted","headers":{"content-length":"755","connection":"close","content-type":"application/json; charset=utf-8","date":"Wed, 24 May 2023 18:59:06 GMT","server":"Microsoft-IIS/10.0","cache-control":"no-cache","expires":"-1","location":"https://my-func.scm.azurewebsites.net/api/deployments/latest?deployer=GITHUB_ZIP_DEPLOY_FUNCTIONS_V1&time=2023-05-24_18-31-48Z","pragma":"no-cache","retry-after":"30","x-ms-request-id":"da171a94-b4ee-4bea-b699-ad6d8d01447d","x-aspnet-version":"4.0.30319","x-powered-by":"ASP.NET"},"body":{"id":"a8c4f086abf04c2abeb4263447fe38d5","status":1,"status_text":"Building and Deploying 'a8c4f086abf04c2abeb4263447fe38d5'.","author_email":"N/A","author":"N/A","deployer":"GITHUB_ZIP_DEPLOY_FUNCTIONS_V1","message":"{\"type\":\"deployment\",\"sha\":\"89a11cc5b0e874124e291836bd7e1eba2ddc46ab\",\"repoName\":\"method-inc/falcon-mft-project-svc\",\"actor\":\"<my-name>\",\"slotName\":\"production\"}","progress":"Running deployment command...","received_time":"2023-05-24T18:32:23.5766618Z","start_time":"2023-05-24T18:32:24.6246668Z","end_time":null,"last_success_end_time":null,"complete":false,"active":false,"is_temp":false,"is_readonly":true,"url":null,"log_url":null,"site_name":"my-func","provisioningState":"InProgress"}}