locked
Deploy Node.js with "npm install && npm run build && npm start" RRS feed

  • Question

  • Hi!

    I'd like to deploy a Node.js webapp. I want to use deployment via GitHub. Whenever there is a new Push an master, the webapp instance should re-deploy by running "npm install && npm run build && npm start". How can I achieve this.

    IMHO these are the basic steps to kick-off a node server. The webapp has been created with "--is-linux" and ideally I don't want to involve kudu.

    Would be nice to have something like azure.config.js

    {

      node: 9.4,

      command: "npm install && npm run build && npm start",

      port: 3000

    }


    Tuesday, January 16, 2018 1:54 PM

All replies

  • You may use the custom deployment script generator tool called kuduscript. Refer the document Custom Deployment Script Generator for more details.

     

    By default, only pushes to the master branch get deployed. But you can change this by calling a REST API on the Kudu service. One simple way to do this is to use curl.

     

    Additionally, refer the links below for details on customizing the deployments: Customizing deployments and Using Gulp in Node.js Azure WebApps

    --------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Tuesday, January 16, 2018 6:27 PM
    Owner