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 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