How to deploy war to the ROOT of tomcat using GitHub Action?

Zhongpu Chen 1 Reputation point
2022-04-20T05:58:41.363+00:00

I am using GitHub Action to deploy the WAR to Web Apps in Azure. The YAML for build and deploy:

- name: Build with gradle
        run: ./gradlew build

      - name: Azure WebApp
        uses: Azure/webapps-deploy@v2
        with:
          app-name: <my-app-name>
          publish-profile: ${<!-- -->{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
          package: build/libs/*.war

It works, but I have to visit the website with the name of the WAR (i.e, <my-name-name>.azurewebsites.net/<war-name>)

So, how can I deploy the WAR to ROOT directly?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhongpu Chen 1 Reputation point
    2022-04-20T06:14:56.393+00:00

    Just rename it to ROOT.war. Add the following between build and deploy:

    - name: rename to ROOT  
            run: mv build/libs/*.war build/libs/ROOT.war
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.