forked from Azure/actions-workflow-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython-webapp-on-azure.yml
42 lines (33 loc) · 1008 Bytes
/
python-webapp-on-azure.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
on: [push,pull_request]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# checkout the repo
- uses: actions/checkout@master
# install dependencies
- name: python install
run: |
sudo apt install python3.6-venv
python3.6 -m venv antenv
source antenv/bin/activate
pip3.6 install setuptools
pip3.6 install -r requirements.txt
# Archive built app
- name: archive myapp
run: |
zip -r myapp.zip .
# Azure login
- uses: azure/actions/login@master
with:
creds: ${{ secrets.AZURE_CREDENTIALS }} # Define secret variable in repository settings as per action documentation
# deploy web app
- uses: azure/webapps-deploy@v1
with:
app-name: mypythonapp # Replace with your app name
package: './myapp.zip'
# Add startup command in app service configuration if required
# Azure logout
- name: logout
run: |
az logout