Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflows for Java projects managed by Gradle #106

Closed
wants to merge 3 commits into from
Closed

Add workflows for Java projects managed by Gradle #106

wants to merge 3 commits into from

Conversation

ChenZhongPu
Copy link

Nowadays, more and more developers would choose Gradle as the build tool for their web projects (e.g., #102).

As a result, I added two workflows based on Gradle, and the main configuration is the same as its Maven counterpart.

As for jar deployment (e.g., Spring boot application):

    - name: Build with Gradle 
      run: ./gradlew bootJar
    - name: 'Deploy to Azure WebApp'
      uses: azure/webapps-deploy@v2
      with: 
        app-name: ${{ env.AZURE_WEBAPP_NAME }}
        publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }}
        package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/build/libs/*.jar'

As for war deployment (e.g., for Tomcat):

    - name: Build with Gradle
      run: ./gradlew build
    - name: 'Deploy to Azure WebApp'
      uses: azure/webapps-deploy@v2
      with: 
        app-name: ${{ env.AZURE_WEBAPP_NAME }}
        publish-profile: ${{ env.AZURE_WEBAPP_PUBLISH_PROFILE }}
        package: '${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/build/libs/*.war'

`./gradlew bootJar` would generate an executable jar.
`./gradlew build` would generate a WAR file, and in order to make it visible at "/", we should rename this WAR to ROOT.war.
@ghost
Copy link

ghost commented Apr 20, 2022

CLA assistant check
All CLA requirements met.

@ChenZhongPu ChenZhongPu closed this by deleting the head repository Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant