-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (45 loc) · 1.96 KB
/
ci.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Clone Twittre Backend API
on:
push:
branches: ["develop", "main", "production"]
pull_request:
branches: ["develop", "main", "production"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.10.14, 3.11.9, 3.12.4]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run migrations
run: |
python manage.py migrate
- name: Run Tests
run: |
python manage.py test -v 2
# - name: Add remote origin Staging
# if: github.ref == 'refs/heads/main' && job.status == 'success' #we specify that this action will ONLY run if everything up to now is successful- so if theres a fail in the tests, then this will not be deployed.
# run: |
# git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/${{ secrets.HEROKU_APP_NAME_STAGING }}.git
# - name: Deploy to Heroku Staging
# if: github.ref == 'refs/heads/main' && job.status == 'success'
# run: |
# git push
# - name: Add remote origin Production
# if: github.ref == 'refs/heads/production' && job.status == 'success' #we specify that this action will ONLY run if everything up to now is successful- so if theres a fail in the tests, then this will not be deployed.
# run: |
# git remote add heroku https://heroku:${{ secrets.HEROKU_API_KEY }}@git.heroku.com/${{ secrets.HEROKU_APP_NAME_PRODUCTION }}.git
# - name: Deploy to Heroku Production
# if: github.ref == 'refs/heads/production' && job.status == 'success'
# run: |
# git push