Skip to content

Commit 159d23a

Browse files
authored
Update main_todo-python-api.yml
1 parent 32ad003 commit 159d23a

1 file changed

Lines changed: 17 additions & 23 deletions

File tree

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
2-
# More GitHub Actions for Azure: https://github.com/Azure/actions
3-
# More info on Python, GitHub Actions, and Azure App Service: https://aka.ms/python-webapps-actions
4-
51
name: Build and deploy Python app to Azure Web App - todo-python-api
62

73
on:
@@ -14,7 +10,7 @@ jobs:
1410
build:
1511
runs-on: ubuntu-latest
1612
permissions:
17-
contents: read #This is required for actions/checkout
13+
contents: read
1814

1915
steps:
2016
- uses: actions/checkout@v4
@@ -28,30 +24,30 @@ jobs:
2824
run: |
2925
python -m venv venv
3026
source venv/bin/activate
31-
27+
working-directory: src/api
28+
3229
- name: Install dependencies
3330
run: pip install -r requirements.txt
34-
35-
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
31+
working-directory: src/api
32+
33+
# Optional: Add step to run tests here
3634

3735
- name: Zip artifact for deployment
3836
run: zip release.zip ./* -r
37+
working-directory: src/api
3938

4039
- name: Upload artifact for deployment jobs
4140
uses: actions/upload-artifact@v4
4241
with:
4342
name: python-app
44-
path: |
45-
release.zip
46-
!venv/
43+
path: src/api/release.zip
4744

4845
deploy:
4946
runs-on: ubuntu-latest
5047
needs: build
51-
52-
permissions:
53-
id-token: write #This is required for requesting the JWT
54-
contents: read #This is required for actions/checkout
48+
permissions:
49+
id-token: write
50+
contents: read
5551

5652
steps:
5753
- name: Download artifact from build job
@@ -62,18 +58,16 @@ jobs:
6258
- name: Unzip artifact for deployment
6359
run: unzip release.zip
6460

65-
66-
- name: Login to Azure
67-
uses: azure/login@v2
68-
with:
69-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }}
70-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }}
71-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }}
61+
- name: Login to Azure
62+
uses: azure/login@v2
63+
with:
64+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1E12482F18E24062ADAA1F4BD6B29335 }}
65+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_3276D62CD33C40D2A069B91CDD6176BC }}
66+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_5BF9C6F332B048678FDDF03501410E3D }}
7267

7368
- name: 'Deploy to Azure Web App'
7469
uses: azure/webapps-deploy@v3
7570
id: deploy-to-webapp
7671
with:
7772
app-name: 'todo-python-api'
7873
slot-name: 'Production'
79-

0 commit comments

Comments
 (0)