From 093e98289fcf0fc5071677cb7bc7865ebb4bc1d0 Mon Sep 17 00:00:00 2001 From: Kranthi86 <108895516+Kranthi86@users.noreply.github.com> Date: Tue, 7 May 2024 12:12:39 -0500 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..cf34ead --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ + +name: Deploy App to Azure App Service + +on: + push: + branches: + - deploy-to-azure-app-service + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v3 + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + - name: Build Project + run: mvn clean install -DskipTests + - name: Upload Artifacct for deployment job + uses: actions/upload-artifact@v2 + with: + name: springboot-example + path: ${{ github.workspace }}/target/*.jar + deploy: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download Artifact from build job + uses: actions/download-artifact@v2 + with: + name: springboot-example + - name: Deploy to Azure App Service + uses: azure/webapps-deploy@v2 + with: + app-name: kranthipep + publish-profile: ${{ secrets.KRANTHI_SECRET }} + package: '*.jar'