This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend App CI / CD progress | |
permissions: | |
contents: read | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'backend/**/*' | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main | |
env: | |
AZURE_WEBAPP_NAME: nanuri-api-backend # set this to your application's name | |
AZURE_WEBAPP_PACKAGE_PATH: ${{ github.workspace }}/backend # set this to the path to your web app project | |
AZURE_WEBAPP_PUBLISH_PROFILE: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
jobs: | |
build: | |
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./backend | |
name: CI using Gradle Build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'corretto' | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew bootJar | |
- name: Set Jar file to app.jar | |
run: | | |
mv ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/build/libs/nanuri-server-0.0.1.jar ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}/build/libs/app.jar | |
- 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/app.jar' |