Skip to content

Commit 73ebf9d

Browse files
committed
Add or update the Azure App Service build and deployment workflow config
1 parent 01c316e commit 73ebf9d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
5+
name: Build and deploy Python app to Azure Web App - quickbite-sfit
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python version
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: '3.9'
24+
25+
- name: Create and start virtual environment
26+
run: |
27+
python -m venv venv
28+
source venv/bin/activate
29+
30+
- name: Install dependencies
31+
run: pip install -r requirements.txt
32+
33+
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
34+
35+
- name: Zip artifact for deployment
36+
run: zip release.zip ./* -r
37+
38+
- name: Upload artifact for deployment jobs
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: python-app
42+
path: |
43+
release.zip
44+
!venv/
45+
46+
deploy:
47+
runs-on: ubuntu-latest
48+
needs: build
49+
environment:
50+
name: 'Production'
51+
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
52+
53+
steps:
54+
- name: Download artifact from build job
55+
uses: actions/download-artifact@v3
56+
with:
57+
name: python-app
58+
59+
- name: Unzip artifact for deployment
60+
run: unzip release.zip
61+
62+
63+
- name: 'Deploy to Azure Web App'
64+
uses: azure/webapps-deploy@v2
65+
id: deploy-to-webapp
66+
with:
67+
app-name: 'quickbite-sfit'
68+
slot-name: 'Production'
69+
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C5AF9ADFB6B0479186D5C4E0D1D8024C }}

0 commit comments

Comments
 (0)