-
-
Notifications
You must be signed in to change notification settings - Fork 41
37 lines (30 loc) · 1.03 KB
/
deploy.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
name: Deploy to Heroku
on:
push:
branches:
- main # Change this to your default branch if it's different
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.11' # Specify the Python version you want to use
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: |
python -m unittest discover -s tests/unit
- name: Deploy to Heroku
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} # Set this in your GitHub repository secrets
run: |
curl https://cli-assets.heroku.com/install.sh | sh
heroku auth:token
heroku git:remote -a your-heroku-app-name # Replace with your Heroku app name
git push heroku main # Change 'main' if your default branch is different