-
Notifications
You must be signed in to change notification settings - Fork 4
72 lines (68 loc) · 1.76 KB
/
main.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: CI
on:
push:
branches:
- master
- deploy
pull_request:
branches:
- master
jobs:
test:
name: Run tests
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:10
env:
POSTGRES_DB: bga_payroll
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install pip==24.0
pip install setuptools_scm
pip install -r requirements.txt
npm install -g jshint
- name: Test with pytest
run: |
cp configs/test_settings_deployment.py bga_database/local_settings.py
pytest -sv
jshint bga_database/static/js/*.js
deploy:
if:
contains('
refs/heads/master
refs/heads/deploy
', github.ref)
needs: test
name: Deploy to AWS
runs-on: ubuntu-20.04
steps:
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- uses: actions/checkout@v2
- id: deploy
uses: webfactory/create-aws-codedeploy-deployment@0d7a684950dae16883a140dd950257958730e0b5
with:
application: bga-payroll