From 5462737b602494606687e975177112379986720b Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:24:37 +0800 Subject: [PATCH 1/7] Create workflow using Azure CLI --- .github/workflows/main_demo-backend-flask.yml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main_demo-backend-flask.yml diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml new file mode 100644 index 000000000..e5933f4dd --- /dev/null +++ b/.github/workflows/main_demo-backend-flask.yml @@ -0,0 +1,35 @@ +# 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 Python app to Azure Web App: demo-backend-flask' + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python version + uses: actions/setup-python@v1 + with: + python-version: '3.11' + + - name: Build using AppService-Build + uses: azure/appservice-build@v2 + with: + platform: python + platform-version: '3.11' + + - name: 'Deploy to Azure Web App' + uses: azure/webapps-deploy@v2 + with: + app-name: 'demo-backend-flask' + slot-name: 'production' + publish-profile: ${{ secrets.AzureAppService_PublishProfile_2a585577347f4d46909d198cb4b682b9 }} From 551313a7624839582405968d554727ebffab04e5 Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:30:16 +0800 Subject: [PATCH 2/7] Update main_demo-backend-flask.yml --- .github/workflows/main_demo-backend-flask.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index e5933f4dd..bca089e1e 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -9,6 +9,10 @@ on: - main workflow_dispatch: +env: + AZURE_WEBAPP_NAME: demo-backend-flask + PYTHON_VERSION: "3.11" + jobs: build-and-deploy: runs-on: ubuntu-latest @@ -17,19 +21,19 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python version - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: - python-version: '3.11' + python-version: ${{ env.PYTHON_VERSION }} - name: Build using AppService-Build uses: azure/appservice-build@v2 with: platform: python - platform-version: '3.11' + platform-version: ${{ env.PYTHON_VERSION }} - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 with: - app-name: 'demo-backend-flask' + app-name: ${{ env.AZURE_WEBAPP_NAME }} slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_2a585577347f4d46909d198cb4b682b9 }} From ff906effba390dba8ddc6a1a433f81ab766bc008 Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:39:21 +0800 Subject: [PATCH 3/7] Lowering the version of python to support Oryx --- .github/workflows/main_demo-backend-flask.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index bca089e1e..60fe799ac 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -11,7 +11,7 @@ on: env: AZURE_WEBAPP_NAME: demo-backend-flask - PYTHON_VERSION: "3.11" + PYTHON_VERSION: "3.10" jobs: build-and-deploy: From 01cefd85ac8767bf0140b88d5c5bfc6352499f53 Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:46:56 +0800 Subject: [PATCH 4/7] Update main_demo-backend-flask.yml --- .github/workflows/main_demo-backend-flask.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index 60fe799ac..696314be9 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -11,25 +11,27 @@ on: env: AZURE_WEBAPP_NAME: demo-backend-flask - PYTHON_VERSION: "3.10" + PYTHON_VERSION: "3.11" jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python version - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} - name: Build using AppService-Build - uses: azure/appservice-build@v2 + uses: azure/appservice-build@v3 with: platform: python platform-version: ${{ env.PYTHON_VERSION }} + source-directory: ${{ github.workspace }} + output-directory: ${{ github.workspace }}/output - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 @@ -37,3 +39,4 @@ jobs: app-name: ${{ env.AZURE_WEBAPP_NAME }} slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_2a585577347f4d46909d198cb4b682b9 }} + package: ${{ github.workspace }}/output From 22df489ab7ffcaaa430c8ef089a0fde42eabd9b9 Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:50:41 +0800 Subject: [PATCH 5/7] Update main_demo-backend-flask.yml --- .github/workflows/main_demo-backend-flask.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index 696314be9..ba74f4cfb 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -30,8 +30,6 @@ jobs: with: platform: python platform-version: ${{ env.PYTHON_VERSION }} - source-directory: ${{ github.workspace }} - output-directory: ${{ github.workspace }}/output - name: 'Deploy to Azure Web App' uses: azure/webapps-deploy@v2 From 449ebb8928f0056d8bb179bdd2517e230298423c Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 22:55:20 +0800 Subject: [PATCH 6/7] Update main_demo-backend-flask.yml --- .github/workflows/main_demo-backend-flask.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index ba74f4cfb..54d18a369 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -37,4 +37,3 @@ jobs: app-name: ${{ env.AZURE_WEBAPP_NAME }} slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_2a585577347f4d46909d198cb4b682b9 }} - package: ${{ github.workspace }}/output From 80d7b2b369ca814566e9617ae7f353ccf3d372e4 Mon Sep 17 00:00:00 2001 From: Setu Chokshi Date: Tue, 20 Aug 2024 23:02:47 +0800 Subject: [PATCH 7/7] Update main_demo-backend-flask.yml --- .github/workflows/main_demo-backend-flask.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main_demo-backend-flask.yml b/.github/workflows/main_demo-backend-flask.yml index 54d18a369..a3280038b 100644 --- a/.github/workflows/main_demo-backend-flask.yml +++ b/.github/workflows/main_demo-backend-flask.yml @@ -32,8 +32,7 @@ jobs: platform-version: ${{ env.PYTHON_VERSION }} - name: 'Deploy to Azure Web App' - uses: azure/webapps-deploy@v2 + uses: azure/webapps-deploy@v3 with: app-name: ${{ env.AZURE_WEBAPP_NAME }} - slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_2a585577347f4d46909d198cb4b682b9 }}