-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.31 KB
/
django_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
57
58
name: Python application
on:
pull_request:
push:
branches:
- master
jobs:
build:
env:
PIPENV_NO_INHERIT: 1
PIPENV_IGNORE_VIRTUALENVS: 1
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ['5432:5432']
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install pipenv
pipenv sync --dev
cp contrib/env-sample .env
- name: Lint with flake8
run: |
pipenv run flake8 .
- name: DB migrations
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres
run: |
pipenv run ./manage.py migrate --noinput
- name: Test with pytest
run: |
pipenv run pytest --cov=pypro
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --remote-only