From 8bf18e3d322747bafbabbee49c36d42db34f215d Mon Sep 17 00:00:00 2001 From: Takohashi42 <119644044+Takohashi42@users.noreply.github.com> Date: Sun, 25 Jun 2023 10:48:56 +0900 Subject: [PATCH 1/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_euswebapply.yml | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/main_euswebapply.yml diff --git a/.github/workflows/main_euswebapply.yml b/.github/workflows/main_euswebapply.yml new file mode 100644 index 000000000000..ed31b071cecd --- /dev/null +++ b/.github/workflows/main_euswebapply.yml @@ -0,0 +1,53 @@ +# 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 JAR app to Azure Web App - euswebapply + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Java version + uses: actions/setup-java@v1 + with: + java-version: '17' + + - name: Build with Maven + run: mvn clean install + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v2 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: 'Production' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v2 + with: + name: java-app + + - name: Deploy to Azure Web App + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: 'euswebapply' + slot-name: 'Production' + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_85395994D08D4A66A803F5144004CE84 }} + package: '*.jar' From f246793ee27781221fbb162626fbe09e24db3f94 Mon Sep 17 00:00:00 2001 From: Takohashi42 <119644044+Takohashi42@users.noreply.github.com> Date: Sun, 25 Jun 2023 10:57:12 +0900 Subject: [PATCH 2/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_euswebapply.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_euswebapply.yml b/.github/workflows/main_euswebapply.yml index ed31b071cecd..e48c0afa702a 100644 --- a/.github/workflows/main_euswebapply.yml +++ b/.github/workflows/main_euswebapply.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 @@ -31,12 +31,12 @@ jobs: path: '${{ github.workspace }}/target/*.jar' deploy: - runs-on: ubuntu-latest + runs-on: windows-latest needs: build environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job uses: actions/download-artifact@v2 @@ -49,5 +49,5 @@ jobs: with: app-name: 'euswebapply' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_85395994D08D4A66A803F5144004CE84 }} + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CF1CEC0E47934850BC41DB86703E5F1D }} package: '*.jar' From cf1678f6db58e311d6e313891ff71109affe7156 Mon Sep 17 00:00:00 2001 From: Takohashi42 <119644044+Takohashi42@users.noreply.github.com> Date: Sun, 25 Jun 2023 11:10:43 +0900 Subject: [PATCH 3/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_euswebapply.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_euswebapply.yml b/.github/workflows/main_euswebapply.yml index e48c0afa702a..2588a83a68ea 100644 --- a/.github/workflows/main_euswebapply.yml +++ b/.github/workflows/main_euswebapply.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -31,12 +31,12 @@ jobs: path: '${{ github.workspace }}/target/*.jar' deploy: - runs-on: windows-latest + runs-on: ubuntu-latest needs: build environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job uses: actions/download-artifact@v2 @@ -49,5 +49,5 @@ jobs: with: app-name: 'euswebapply' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_CF1CEC0E47934850BC41DB86703E5F1D }} + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0DE6360D09224336A6570AE67078D1AF }} package: '*.jar' From fc3c76b3ab06d6a17b48cf739f897e7c46ce0b36 Mon Sep 17 00:00:00 2001 From: Takohashi42 <119644044+Takohashi42@users.noreply.github.com> Date: Sun, 25 Jun 2023 13:31:18 +0900 Subject: [PATCH 4/5] Add or update the Azure App Service build and deployment workflow config --- .github/workflows/main_euswebapply.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_euswebapply.yml b/.github/workflows/main_euswebapply.yml index 2588a83a68ea..c30e7f0a1039 100644 --- a/.github/workflows/main_euswebapply.yml +++ b/.github/workflows/main_euswebapply.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v2 @@ -31,12 +31,12 @@ jobs: path: '${{ github.workspace }}/target/*.jar' deploy: - runs-on: ubuntu-latest + runs-on: windows-latest needs: build environment: name: 'Production' url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} - + steps: - name: Download artifact from build job uses: actions/download-artifact@v2 @@ -49,5 +49,5 @@ jobs: with: app-name: 'euswebapply' slot-name: 'Production' - publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_0DE6360D09224336A6570AE67078D1AF }} + publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_AEA25C2CDEF741F88A3EC792F0205802 }} package: '*.jar' From b85af22db9a2fe3014e4089b4b91e9fff53be4cb Mon Sep 17 00:00:00 2001 From: Takohashi42 <119644044+Takohashi42@users.noreply.github.com> Date: Mon, 10 Jul 2023 12:50:19 +0900 Subject: [PATCH 5/5] Create azure-webapps-node.yml --- .github/workflows/azure-webapps-node.yml | 78 ++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/azure-webapps-node.yml diff --git a/.github/workflows/azure-webapps-node.yml b/.github/workflows/azure-webapps-node.yml new file mode 100644 index 000000000000..f8d41d9acb07 --- /dev/null +++ b/.github/workflows/azure-webapps-node.yml @@ -0,0 +1,78 @@ +# This workflow will build and push a node.js application to an Azure Web App when a commit is pushed to your default branch. +# +# This workflow assumes you have already created the target Azure App Service web app. +# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-cli +# +# To configure this workflow: +# +# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal. +# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials +# +# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret. +# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret +# +# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables below. +# +# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions +# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy +# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples + +on: + push: + branches: [ "main" ] + workflow_dispatch: + +env: + AZURE_WEBAPP_NAME: your-app-name # set this to your application's name + AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root + NODE_VERSION: '14.x' # set this to the node version to use + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: npm install, build, and test + run: | + npm install + npm run build --if-present + npm run test --if-present + + - name: Upload artifact for deployment job + uses: actions/upload-artifact@v3 + with: + name: node-app + path: . + + deploy: + permissions: + contents: none + runs-on: ubuntu-latest + needs: build + environment: + name: 'Development' + url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} + + steps: + - name: Download artifact from build job + uses: actions/download-artifact@v3 + with: + name: node-app + + - name: 'Deploy to Azure WebApp' + id: deploy-to-webapp + uses: azure/webapps-deploy@v2 + with: + app-name: ${{ env.AZURE_WEBAPP_NAME }} + publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} + package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}