Skip to content

Commit 58b4bc8

Browse files
Update main_ai-dslab-backend.yml
1 parent c48ad7a commit 58b4bc8

File tree

1 file changed

+15
-52
lines changed

1 file changed

+15
-52
lines changed

.github/workflows/main_ai-dslab-backend.yml

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -11,71 +11,34 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
build:
14+
build-and-deploy:
1515
runs-on: ubuntu-latest
16-
permissions:
17-
contents: read #This is required for actions/checkout
1816

1917
steps:
20-
- uses: actions/checkout@v4
18+
- name: Checkout code
19+
uses: actions/checkout@v4
2120

22-
- name: Set up Python version
21+
- name: Set up Python
2322
uses: actions/setup-python@v5
2423
with:
2524
python-version: '3.10'
2625

27-
- name: Create and start virtual environment
28-
run: |
29-
python -m venv venv
30-
source venv/bin/activate
31-
3226
- name: Install dependencies
33-
run: pip install -r requirements.txt
34-
35-
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
36-
37-
- name: Zip artifact for deployment
38-
run: zip release.zip ./* -r
39-
40-
- name: Upload artifact for deployment jobs
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: python-app
44-
path: |
45-
release.zip
46-
!venv/
47-
48-
deploy:
49-
runs-on: ubuntu-latest
50-
needs: build
51-
environment:
52-
name: 'Production'
53-
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
54-
permissions:
55-
id-token: write #This is required for requesting the JWT
56-
contents: read #This is required for actions/checkout
27+
working-directory: backend
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
5731
58-
steps:
59-
- name: Download artifact from build job
60-
uses: actions/download-artifact@v4
32+
- name: Login to Azure
33+
uses: azure/login@v2
6134
with:
62-
name: python-app
63-
64-
- name: Unzip artifact for deployment
65-
run: unzip release.zip
66-
67-
68-
- name: Login to Azure
69-
uses: azure/login@v2
70-
with:
71-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1FAE509EB83D4609AE36AC7F0F996753 }}
72-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_1CAD4C5815F74749A836FC494CB56088 }}
73-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_BF92A8605B30418D89D037A4530EF5D2 }}
35+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_1FAE509EB83D4609AE36AC7F0F996753 }}
36+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_1CAD4C5815F74749A836FC494CB56088 }}
37+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_BF92A8605B30418D89D037A4530EF5D2 }}
7438

75-
- name: 'Deploy to Azure Web App'
39+
- name: Deploy to Azure Web App
7640
uses: azure/webapps-deploy@v3
77-
id: deploy-to-webapp
7841
with:
7942
app-name: 'ai-dslab-backend'
8043
slot-name: 'Production'
81-
44+
package: backend

0 commit comments

Comments
 (0)