File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 - az104webapp1
6+
7+ on :
8+ push :
9+ branches :
10+ - master
11+ workflow_dispatch :
12+
13+ jobs :
14+ build :
15+ runs-on : ubuntu-latest
16+
17+ steps :
18+ - uses : actions/checkout@v2
19+
20+ - name : Set up Python version
21+ uses : actions/setup-python@v1
22+ with :
23+ python-version : ' 3.8'
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 : Upload artifact for deployment jobs
36+ uses : actions/upload-artifact@v2
37+ with :
38+ name : python-app
39+ path : |
40+ .
41+ !venv/
42+
43+ deploy :
44+ runs-on : ubuntu-latest
45+ needs : build
46+ environment :
47+ name : ' production'
48+ url : ${{ steps.deploy-to-webapp.outputs.webapp-url }}
49+
50+ steps :
51+ - name : Download artifact from build job
52+ uses : actions/download-artifact@v2
53+ with :
54+ name : python-app
55+ path : .
56+
57+ - name : ' Deploy to Azure Web App'
58+ uses : azure/webapps-deploy@v2
59+ with :
60+ app-name : ' az104webapp1'
61+ slot-name : ' production'
62+ publish-profile : ${{ secrets.AzureAppService_PublishProfile_22f725fbd7724444991fd3b24d4a895c }}
You can’t perform that action at this time.
0 commit comments