From 9b6e4b1faa475c49f6fd337e2ef0f20f6010dfed Mon Sep 17 00:00:00 2001 From: root Date: Mon, 28 Aug 2023 09:33:09 +0000 Subject: [PATCH 1/2] Added the Dockerfile --- Dockerfile | 6 ++++++ Dockerfile.save | 1 + 2 files changed, 7 insertions(+) create mode 100644 Dockerfile create mode 100644 Dockerfile.save diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d720573 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM openjdk:17 +EXPOSE 8080 +ARG JAR_FILE=target/spring-petclinic-3.1.0-SNAPSHOT.jar +COPY ${JAR_FILE} app.jar +ENTRYPOINT ["java","-jar","/app.jar"] + diff --git a/Dockerfile.save b/Dockerfile.save new file mode 100644 index 0000000..750cfa5 --- /dev/null +++ b/Dockerfile.save @@ -0,0 +1 @@ +From From 4bb37d5676681c31d82a3920f12ae82b491c6d2f Mon Sep 17 00:00:00 2001 From: Shaurya Pratap Singh <88338519+K-Rage@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:22:23 +0530 Subject: [PATCH 2/2] Add or update the App Service deployment workflow configuration from Azure Portal. --- .../workflows/Feature_SPSB_ShauryaWEBAPP.yml | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/Feature_SPSB_ShauryaWEBAPP.yml diff --git a/.github/workflows/Feature_SPSB_ShauryaWEBAPP.yml b/.github/workflows/Feature_SPSB_ShauryaWEBAPP.yml new file mode 100644 index 0000000..17a2c5d --- /dev/null +++ b/.github/workflows/Feature_SPSB_ShauryaWEBAPP.yml @@ -0,0 +1,51 @@ +# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# More GitHub Actions for Azure: https://github.com/Azure/actions + +name: Build and deploy container app to Azure Web App - ShauryaWEBAPP + +on: + push: + branches: + - Feature_SPSB + workflow_dispatch: + +jobs: + build: + runs-on: 'ubuntu-latest' + + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to registry + uses: docker/login-action@v2 + with: + registry: https://index.docker.io/v1/ + username: ${{ secrets.AzureAppService_ContainerUsername_48a8df1da16c422b88dba65f7d3e7cf5 }} + password: ${{ secrets.AzureAppService_ContainerPassword_918852819b30411d8a1817eec83435fa }} + + - name: Build and push container image to registry + uses: docker/build-push-action@v3 + with: + push: true + tags: index.docker.io/${{ secrets.AzureAppService_ContainerUsername_48a8df1da16c422b88dba65f7d3e7cf5 }}/shauryapratap44/streamlinesolutions1:${{ github.sha }} + file: ./Dockerfile + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'ShauryaWEBAPP' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_dcf3bd538db64ce4ae5ff92c2e62c54c }} + images: 'index.docker.io/${{ secrets.AzureAppService_ContainerUsername_48a8df1da16c422b88dba65f7d3e7cf5 }}/shauryapratap44/streamlinesolutions1:${{ github.sha }}' \ No newline at end of file