Azure Web应用程序部署成功,但未更新Web应用程序 [英] Azure Web application deployment successful, but does not update the web application

查看:94
本文介绍了Azure Web应用程序部署成功,但未更新Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以前,我在Azure上的Web Service Linux上部署React应用程序时出错.我在上一篇文章中解决了这个问题,请点击以下链接:.

Previously I was having an error with the deployment of my React application on Web Service Linux on Azure. This problem was solved in the previous post I did, follow the link: My Azure Web Application on Linux is not working. The error message on azure logs "react-scripts: not found" and github "npm ERR! code ELIFECYCLE ".

现在我遇到另一个问题,该问题包括以下内容:部署到Azure平台后(我使用github选项进行部署)并收到成功部署通知,进入我的github存储库后,我收到了错误消息" npm ERR!代码ELIFECYCLE";(点击链接以查看整个日志: https://mega.nz/folder/eth0WSiL#pGvXl2yShQfUrNELCKD3cA ).进入应用程序并对其进行测试后,我注意到该部署确实无法正常工作.

Now I am having another problem which consists of the following: After deploying to the Azure platform (I'm using the github option for deployment) and receiving a successful deployment notification, upon entering my github repository, I received the error "npm ERR! Code ELIFECYCLE" (follow the link to view the entire log: https://mega.nz/folder/eth0WSiL#pGvXl2yShQfUrNELCKD3cA). Upon entering the application and testing it I noticed that the deployment really did not work.

值得一提的重要一点是,在上一个问题中,@ JasonPan通过的解决方案有效,但是当我们对其进行测试时,我仍然使用Azure经典部署中心,几天前已删除,在尝试使用当前部署中心后,我遇到了此错误.

An important point worth mentioning that in the previous problem the solution passed by @JasonPan worked, but when we tested it I still used the Azure classic deployment center, which was removed a few days ago and after trying to use the current deployment center I came across this error.

推荐答案

我设法解决了这个问题.我需要在.yml文件中做两件事,它们是:添加配置项:false并删除npm运行测试这是代码:

I managed to solve the problem. I needed to do two things within my .yml file, they were: add a CI: false and remove the npm run test Here is the code:

    jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Set up Node.js version
      uses: actions/setup-node@v1
      with:
        node-version: '14.x'

    - name: npm install, build
      run: |
        npm install
        npm run build --if-present

    - name: Upload artifact for deployment job
      uses: actions/upload-artifact@v2
      with:
        name: node-app
        path: .

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      CI: false
      name: 'production'
      url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

.yml文件在更改之前:

The .yml file before it was changed:

jobs:
      build:
        runs-on: ubuntu-latest
    
        steps:
        - uses: actions/checkout@v2
    
        - name: Set up Node.js version
          uses: actions/setup-node@v1
          with:
            node-version: '14.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@v2
          with:
            name: node-app
            path: .
    
      deploy:
        runs-on: ubuntu-latest
        needs: build
        environment:
          name: 'production'
          url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

这篇关于Azure Web应用程序部署成功,但未更新Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆