Create python-app.yml
Browse files
.github/workflows/python-app.yml
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
| 2 |
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
| 3 |
+
|
| 4 |
+
name: Deploy to Heroku
|
| 5 |
+
|
| 6 |
+
on:
|
| 7 |
+
push:
|
| 8 |
+
branches: [ main ]
|
| 9 |
+
|
| 10 |
+
jobs:
|
| 11 |
+
build:
|
| 12 |
+
|
| 13 |
+
runs-on: ubuntu-latest
|
| 14 |
+
|
| 15 |
+
steps:
|
| 16 |
+
- uses: actions/checkout@v2
|
| 17 |
+
- name: Set up Python 3.8
|
| 18 |
+
uses: actions/setup-python@v2
|
| 19 |
+
with:
|
| 20 |
+
python-version: 3.8
|
| 21 |
+
- name: Install dependencies
|
| 22 |
+
run: |
|
| 23 |
+
python -m pip install --upgrade pip
|
| 24 |
+
pip install pipreqs
|
| 25 |
+
- name: Update requirements.txt
|
| 26 |
+
run: pipreqs --print . | sort > requirements.txt
|
| 27 |
+
- name: Check Git changes
|
| 28 |
+
run: test "$(git diff --stat)" = ""
|
| 29 |
+
|
| 30 |
+
deploy:
|
| 31 |
+
needs: [build]
|
| 32 |
+
runs-on: ubuntu-latest
|
| 33 |
+
steps:
|
| 34 |
+
- uses: actions/checkout@v2
|
| 35 |
+
- uses: akhileshns/heroku-deploy@v3.8.9
|
| 36 |
+
with:
|
| 37 |
+
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
|
| 38 |
+
heroku_app_name: streamlit-webrtc-example
|
| 39 |
+
heroku_email: ${{ secrets.HEROKU_EMAIL }}
|
| 40 |
+
|