Skip to content

Commit 5e3ba06

Browse files
committed
Simplify Azure deployment to use publish profile with webapps-deploy action instead of Azure CLI
1 parent 9f6df7b commit 5e3ba06

1 file changed

Lines changed: 8 additions & 38 deletions

File tree

.github/workflows/azure_stock-dashboard-python.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
name: Build and deploy Python app to Azure Web App - stock-dashboard-python
66

7+
env:
8+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
9+
710
on:
811
push:
912
branches:
@@ -51,50 +54,17 @@ jobs:
5154
runs-on: ubuntu-latest
5255
needs: build
5356
permissions:
54-
id-token: write #This is required for requesting the JWT
5557
contents: read #This is required for actions/checkout
5658

5759
steps:
5860
- name: Download artifact from build job
5961
uses: actions/download-artifact@v4.3.0
6062
with:
6163
name: python-app
62-
63-
- name: Login to Azure
64-
uses: azure/login@v2.3.0
65-
with:
66-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_F3A2B6BE01664787B76B07AC353D33D3 }}
67-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_298CA90AA01E48B1ADA79A4DC7FA91B6 }}
68-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EB6A5C6853294E129D054A838DBC3358 }}
69-
70-
- name: 'Zip artifact for deployment'
71-
run: zip -r app.zip . -x "*.git*" -x "antenv/*"
72-
73-
- name: 'Configure Azure Web App for Python zip deploy'
74-
run: |
75-
az webapp config appsettings set \
76-
--resource-group ${{ secrets.AZUREAPPSERVICE_RESOURCEGROUP }} \
77-
--name stock-dashboard-python \
78-
--settings \
79-
SCM_DO_BUILD_DURING_DEPLOYMENT=true \
80-
ENABLE_ORYX_BUILD=true
81-
az webapp config appsettings delete \
82-
--resource-group ${{ secrets.AZUREAPPSERVICE_RESOURCEGROUP }} \
83-
--name stock-dashboard-python \
84-
--setting-names WEBSITE_RUN_FROM_PACKAGE || true
85-
az webapp config set \
86-
--resource-group ${{ secrets.AZUREAPPSERVICE_RESOURCEGROUP }} \
87-
--name stock-dashboard-python \
88-
--startup-file "gunicorn --bind=0.0.0.0 --timeout 600 app:server"
89-
9064
- name: 'Deploy to Azure Web App'
91-
run: |
92-
az webapp deploy \
93-
--resource-group ${{ secrets.AZUREAPPSERVICE_RESOURCEGROUP }} \
94-
--name stock-dashboard-python \
95-
--src-path app.zip \
96-
--type zip \
97-
--async false \
98-
--track-status false \
99-
--clean true
65+
uses: azure/webapps-deploy@v3
66+
with:
67+
app-name: 'stock-dashboard-python'
68+
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
69+
package: .
10070

0 commit comments

Comments
 (0)