Skip to content

Commit 72ced5d

Browse files
committed
Refactor deployment workflow to create and start virtual environment in server directory
1 parent 9c22edb commit 72ced5d

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

.github/workflows/main_devhub-server.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,40 @@ jobs:
2222
with:
2323
python-version: '3.11'
2424

25-
- name: Create and start virtual environment
25+
- name: Create and start virtual environment in server directory
2626
run: |
27+
cd ./server
2728
python -m venv venv
2829
source venv/bin/activate
2930
3031
- name: Install dependencies
31-
run: pip install -r requirements.txt
32+
run: |
33+
cd ./server
34+
pip install -r requirements.txt
3235
3336
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
3437

3538
- name: Zip artifact for deployment
36-
run: zip release.zip ./* -r
39+
run: |
40+
cd ./server
41+
zip release.zip ./* -r
3742
3843
- name: Upload artifact for deployment jobs
3944
uses: actions/upload-artifact@v4
4045
with:
4146
name: python-app
4247
path: |
43-
release.zip
44-
!venv/
48+
./server/release.zip
49+
!./server/venv/
4550
4651
deploy:
4752
runs-on: ubuntu-latest
4853
needs: build
4954
environment:
5055
name: 'Production'
5156
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
52-
permissions:
53-
id-token: write #This is required for requesting the JWT
57+
permissions:
58+
id-token: write #This is required for requesting the JWT
5459

5560
steps:
5661
- name: Download artifact from build job
@@ -59,15 +64,15 @@ jobs:
5964
name: python-app
6065

6166
- name: Unzip artifact for deployment
62-
run: unzip release.zip
67+
run: unzip ./server release.zip
6368

64-
65-
- name: Login to Azure
66-
uses: azure/login@v2
67-
with:
68-
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_26FCC6BE4D3D4EB68BDD436CE7659427 }}
69-
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_EE8D6B43D1DD4CD1AF32A36BDED9F9CE }}
70-
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EE0C973756654530B0F1EE3790668553 }}
69+
70+
- name: Login to Azure
71+
uses: azure/login@v2
72+
with:
73+
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_26FCC6BE4D3D4EB68BDD436CE7659427 }}
74+
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_EE8D6B43D1DD4CD1AF32A36BDED9F9CE }}
75+
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_EE0C973756654530B0F1EE3790668553 }}
7176

7277
- name: 'Deploy to Azure Web App'
7378
uses: azure/webapps-deploy@v3

0 commit comments

Comments
 (0)